Full Sharh — Mishkat al-Masabih 702
وَعَنْ أَبِي ذَرٍّ قَالَ: قُلْتُ: يَا رَسُولَ اللَّهِ أَيُّ مَسْجِدٍ وُضِعَ فِي الْأَرْضِ أَوَّلُ؟ قَالَ: «الْمَسْجِدُ الْحَرَامُ» قَالَ: قُلْتُ: ثُمَّ أَيْ؟ قَالَ: «ثُمَّ الْمَسْجِدُ الْأَقْصَى» . قُلْتُ: كَمْ بَيْنَهُمَا؟ قَالَ: «أَرْبَعُونَ عَامًا ثُمَّ الْأَرْضُ لَكَ مَسْجِدٌ فَحَيْثُمَا أَدْرَكَتْكَ الصَّلَاةُ فصل»
English Translation
Abu Dharr said that he asked God’s Messenger which mosque was set up first in the earth and was told that it was the sacred mosque. He asked which came next and was told that it was the Aqsa mosque. He asked how long a space of time separated their building and the Prophet told him it was forty years, adding, “Then the earth is a mosque for you, so pray wherever you are at the time of prayer.” (Bukhari and Muslim.)
Source
Mishkat al-Masabih(مشكاة المصابيح)
Prayer
Hadith Number
702