Hadith 1144
Abu Qatadah (May Allah be pleased with him)reported:
وعن أبي قتادة رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم: " إذا دخل أحدكم المسجد فلا يجلس حتى يصلي ركعتين" . ((متفق عليه)).
The Messenger of Allah (ﷺ) said, "When anyone of you enters the mosque, he should perform two Rak'ah (of voluntary prayer) before sitting." [Al-Bukhari and Muslim].
In plain words
The Prophet taught that whenever someone enters the mosque, he should pray two units before sitting down, a simple way of honoring the place of worship on arrival.
Reference : Riyad as-Salihin 1144 In-book reference : Book 8, Hadith 154