(8) The Book of the Masjids
كتاب المساجد
(37) Chapter: The Command To Pray Before Sitting Down In It
(37) باب الأَمْرِ بِالصَّلاَةِ قَبْلَ الْجُلُوسِ فِيهِ
Sunan an-Nasa'i 730 
It was narrated from Abu Qatadah that the Messenger of Allah (ﷺ) said:
"When any one of you enters the Masjid, let him pray two Rak'ahs before he sits down."
أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا مَالِكٌ، عَنْ عَامِرِ بْنِ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ، عَنْ عَمْرِو بْنِ سُلَيْمِ، عَنْ أَبِي قَتَادَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ ‏"‏ ‏.‏
Grade :  Sahih (Darussalam)
Reference : Sunan an-Nasa'i 730
In-book reference : Book 8, Hadith 43
English translation : Vol. 1, Book 8, Hadith 731