Dear Brother Muhammad Yameen.
With all due respect, I think you may be using some terms interchangeably. You mention 'first mosque of Islam' but then seem to refer to mosques such as Quba and Qiblatain.
Islam is not a new religion but one which was revealed to all the prophets of God (42:13). 'Muslim' is quite a hijacked term these days but a Quranic study will show you that it has been used as a term for all those that truly submit to God alone. If you take the meaning of 'Masjid' (Root S-J-D) as any place in which one performs the act of 'Sujood' - prostration (Same root S-J-D) or a place in which one performs worship or devotion then even the people of Moses were instructed to make use of their houses as 'qiblatan' for devotion. Some from the People of the Book also acknowledged to have submitted to God (and therefore called Muslimeen by the Quran) from before the truth of the final revelation came to them (28:53). Disciples of Prophet Jesus (pbuh) confirm that they had submitted to God (Muslimoon) (3:52). Prophet Abraham (pbuh) was a Muslim (3:67) and with son Prophet Ishmael (pbuh) they laid the foundations of arguably the first place of worship. (3:96-97).
If sourcing biographical prophetic history from outside the Quran is an area which is of interest to you, then you may be interested to read the earliest source of these histories for yourself. For example, the earliest source of the Prophet’s biography - Ibn Ishaq (d. 767 CE) (transmitted through Al Bakkai to Ibn Hisham (d. 833 CE) as one source of many) captures the event you question regarding the historical background that led up to the construction of the early mosque.
Later historians such as Al-Tabari (838 CE-923 CE) also rely on early historians such as Ibn Ishaq (and many others) through intermediary transmitters to source their information.
However, a serious CAUTION - this is 'salvage history' at best often nearly 2 centuries removed from source of the event being narrated and on which there has been considerable criticism from both early Muslim and later Muslim/Western scholarship.
The Earliest historians for the Prophet's biography such as Ibn Ishaq and others such as Al Waqidi (d.822 CE), often relied on folklore and various traditions from a plethora of traditionalists (at times indiscriminate) at times citing their sources and at others remaining economical with their source of information.
However, if the appetite still remains, have a look at popular English translations of these works for yourself such as that of Guillaume (Oxford University Press) - The Life of Muhammad, a translation of Ibn Ishaq's Sira - to give you some idea of their works and the histories recorded by them. For example, Page 228 in Part III, entitled the 'Hijra' for example captures a narrative 'The apostle stayed in Quba' among B.Amr b. 'Auf from Monday to Thursday and then he laid the foundation of his mosque. Then God brought him out from them on Friday"
Masjid al-Qiblatain (mosque of the two qiblas) is a separate mosque and is allegedly the location in which the incident of the qibla switch took place that is emphatically captured by verse 2:144. Whether this location is the actual mosque in which the incident took place is dependant on your take on the veracity of the sources and the information that has resulted from it. Ibn Ishaq briefly records the event to my humble knowledge by giving a date of the event. The rest is picked up from other sources e.g. Books of Hadith etc such as Bukhari's work to support the narrative and which were canonised even later.
Just my humble views. As always, I am happy to be corrected and enlightened further with clear evidence :-)