Amr bin Sulaym narrates from Sayyiduna Abu Qatadah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When any of you enters the mosque, let him not sit down before praying two rak'ahs."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجمعة / 5694
Amr bin Sulaym (may Allah have mercy on him) narrates from Sayyiduna Abu Qatadah (may Allah be pleased with him): I entered the mosque while the Prophet (peace and blessings be upon him) was seated among the people. I sat down, and the Prophet (peace and blessings be upon him) said: "What prevented you from praying two rak'ahs before sitting down?" I said: O Messenger of Allah! I saw you sitting and the people were sitting too. He (peace and blessings be upon him) said: "When any of you enters the mosque, let him not sit down until he has prayed two rak'ahs."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجمعة / 5695