Allah's Messenger (ﷺ) said, "If anyone of you enters a mosque, he should pray two rak`at before sitting."
Sahih al-Bukhari Book 8, Hadith 93