Al-Qiblatain, or Two Qiblah Mosque
Al-Qiblatain means two Qiblah because in the mosque there are two Qiblah i.e. Baitul Maqdis (Jerusalem) and the Al-Bait Al-Haram (Makkah Al Mukaromah). The mosque is located in the village of Banu Salamah, Madinah, so it is also called the Mosque of the Banu Salamah.
Al-Bara ‘bin Azib (RA) said in al-Bukhari:
Allah’s Messenger (SAW) prayed towards Baitul-Maqdis for sixteen or seventeen months, but he desired to pray towards the Ka’bah and so Allah the Almighty, the All-Powerful revealed:
“Verily, We have seen the turning of your (Muhammad’s) face towards the heaven.” (Al-Baqarah 2:144)
Then he turned his face to the Ka’aba and the Jews said:
“What has turned them (Muslims) from their Qiblah [prayer direction (towards Jerusalem)] to which they used to face in prayer.” Say (O Muhammad (SAW)): “To Allah belong both, east and the west. He guides whom He wills to the Straight Way.” (Al-Baqarah 2:142)
In another hadith in Al-Bukhari it is stated that:
A man offered prayer with the Prophet (SAW) and then he went out after praying and passed by some people from among the Ansar who were performing the Asr prayer towards Baitul Maqdis, he testified (to them) that he had prayed with Allah’s Messenger (SAW) and that he had turned towards the Ka’bah, so the people in prayer turned until they were facing the Ka’bah.
Source: History of Madinah Munawwarah, Group of Scholars, supervised by Shaikh Safiur-Rahman Mubarakpuri.