(11) باب اسْتِحْبَابِ تَحِيَّةِ الْمَسْجِدِ بِرَكْعَتَيْنِ وَكَرَاهَةِ الْجُلُوسِ قَبْلَ صَلاَتِهِمَا وَأَنَّهَا مَشْرُوعَةٌ فِي جَمِيعِ الأَوْقَاتِ
Abu Qatada (a Companion of the Prophet) reported Allah's Messenger (ﷺ) as saying:
When any one of you enters the mosque, he should observe two rak'ahs (of Nafl prayer) before sitting. (JA)
Reference (JA): Sahih Muslim 714 a (JA)
In-book reference (JA): Book 6, Hadith 84 (JA)
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1540 (JA)