He rose, and the Messenger of Allah ﷺ pronounced the opening takbīr while we lined up behind him. He then prayed two rakʿahs, gave the salām, and we concluded the prayer when he did.
This ḥadīth indicates that if someone wishes to build his mosque on a spot where the Messenger of Allah ﷺ once prayed, there is no objection; the same applies to intentionally praying in a place where he prayed. In the narration at hand, however, the man’s original purpose was to erect a mosque, and he desired that the Prophet ﷺ pray there so that the Prophet himself would designate the boundaries of the mosque. This differs from a location the Prophet ﷺ prayed at only incidentally, which is later turned into a mosque—not because a mosque is needed there, but merely because he had prayed on that spot.
Places the Prophet ﷺ Deliberately Chose for Prayer or Supplication
With respect to the places that the Prophet ﷺ intentionally sought out for prayer or supplication, praying or supplicating there is a Sunnah, done in imitation of and obedience to the Messenger of Allah ﷺ. The ruling is identical to when he singled out a particular time for prayer or supplication: performing those acts at that time likewise becomes a Sunnah, just like his other devotional practices and every act he performed as a means of drawing nearer to Allah. An example is the report recorded by both al-Bukhārī and Muslim from Yazīd ibn Abī ʿUbayd, who said: “Salamah ibn al-Akwāʿ used to make a point of praying by the pillar next to the Qur’an stand. I said to him, ‘Abū Muslim, I see you are keen to pray by this pillar.’”