(11) باب اسْتِحْبَابِ تَحِيَّةِ الْمَسْجِدِ بِرَكْعَتَيْنِ وَكَرَاهَةِ الْجُلُوسِ قَبْلَ صَلاَتِهِمَا وَأَنَّهَا مَشْرُوعَةٌ فِي جَمِيعِ الأَوْقَاتِ
Jabir b. 'Abdullah reported:
The Apostle of Allah (ﷺ) owed me a debt; he paid me back and made an addition (of this). I entered the mosque and he (the Holy Prophet) said to me: Observe two rak'ahs of prayer.
Reference: Sahih Muslim 715 a
In-book reference: Book 6, Hadith 86
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1542