[Machine] The Prophet ﷺ used to pray while he was in Mecca, facing the direction of the Sacred House (Jerusalem) and the Kaaba was in front of him. After migrating for sixteen months, he then turned towards the Kaaba.
«كَانَ النَّبِيُّ ﷺ يُصَلِّي وَهُوَ بِمَكَّةَ نَحْوَ بَيْتِ الْمَقْدِسِ وَالْكَعْبَةُ بَيْنَ يَدَيْهِ وَبَعْدَمَا هَاجَرَ سِتَّةَ عَشَرَ شَهْرًا ثُمَّ انْصَرَفَ إِلَى الْكَعْبَةِ»