Abu Qatadah reported the Messenger of Allah (May peace be upon him) as saying; when any one of you enters the mosque, he should pray two RAKAHS before sitting down.
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا جَاءَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُصَلِّ سَجْدَتَيْنِ مِنْ قَبْلِ أَنْ يَجْلِسَ