Yahya related to me from Malik from Amir ibn Abdullah ibn az- Zubayr from Amr ibn Sulaymaz-Zuraqi from Abu Qatadaal-Ansari that the Messenger of Allah ﷺ said, "When you enter the mosque, you should pray two rakas before you sit down."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ