We prayed along with the Prophet ﷺ facing Jerusalem for sixteen or seventeen months. Then Allah ordered him to turn his face towards the Qibla (in Mecca):-- "And from whence-so-ever you start forth (for prayers) turn your face in the direction of (the Sacred Mosque of Mecca) Al-Masjid-ul Haram.." (2.149)
صَلَّيْنَا مَعَ النَّبِيِّ ﷺ نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ أَوْ سَبْعَةَ عَشَرَ شَهْرًا ثُمَّ صَرَفَهُ نَحْوَ الْقِبْلَةِ