عن أَبي قتادة - رضي الله عنه - قَالَ: قَالَ رسول الله - صلى الله عليه وسلم: «إِذَا دَخَلَ أحَدُكُمُ المَسْجِدَ، فَلاَ يَجْلِسْ حَتَّى يُصَلِّي رَكْعَتَيْنِ». متفقٌ عَلَيْهِ.
It is narrated from Sayyiduna Abu Qatadah (may Allah be pleased with him); he said: The Messenger of Allah (peace and blessings be upon him) said: "When one of you enters the mosque, let him not sit down before praying two rak'ahs."
(Agreed upon)
وعن جابرٍ - رضي الله عنه - قَالَ: أَتَيْتُ النَّبيَّ - صلى الله عليه وسلم - وَهُوَ في المَسْجِدِ، فَقَالَ: «صَلِّ رَكْعَتَيْنِ». متفقٌ عَلَيْهِ.
It is narrated from Sayyiduna Jabir (may Allah be pleased with him); he said: I came to the Prophet (peace and blessings be upon him) while he was in the mosque, and he (peace and blessings be upon him) said: "Pray two rak'ahs."
(Agreed upon)