Hadith 1012
Chapter 57: The one who enters the mosque should not sit down until he performs some Rak’ah - كتاب إقامة الصلاة والسنة فيها
حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ الْحِزَامِيُّ، وَيَعْقُوبُ بْنُ حُمَيْدِ بْنِ كَاسِبٍ، قَالاَ حَدَّثَنَا ابْنُ أَبِي فُدَيْكٍ، عَنْ كَثِيرِ بْنِ زَيْدٍ، عَنِ الْمُطَّلِبِ بْنِ عَبْدِ اللَّهِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ " إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلاَ يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ " .
It was narrated from Abu Hurairah that the Messenger of Allah (ﷺ) said:
“When anyone of you enters the mosque, let him not sit down until he performs two Rak’ah.”
Reference : Sunan Ibn Majah 1012
In-book reference : Book 5, Hadith 210