The Prophet ﷺ said, "If anyone of you enters a Mosque, he should not sit until he has offered a tworakʿ at prayer." (Using translation from Bukhārī 1167)
قَالَ رَسُولُ اللهِ ﷺ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلَا يَجْلِسْ حَتَّى يُصَلِّيَ رَكْعَتَيْنِ