Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:714bAbū Bakr b. Abū Shaybah > Ḥusayn b. ʿAlī > Zāʾidah > ʿAmr b. Yaḥyá al-Anṣārī > Muḥammad b. Yaḥyá b. Ḥabbān > ʿAmr b. Sulaym b. Khaldah al-Anṣārī

I entered the mosque, when the Messenger of Allah ﷺ had been sitting among people, and I also sat down among them. Upon this the Messenger of Allah ﷺ said: What prevented you from offering two rak'ahs (of Nafl prayer) before sitting down? I said: Messenger of Allah, I saw you sitting and people sitting (around you and I, therefore, sat in your company). He (the Holy Prophet) then said: When anyone among you enters the mosque, he should not sit till he has observed two rak'ahs.  

مسلم:٧١٤bحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ عَنْ زَائِدَةَ قَالَ حَدَّثَنِي عَمْرُو بْنُ يَحْيَى الأَنْصَارِيُّ حَدَّثَنِي مُحَمَّدُ بْنُ يَحْيَى بْنِ حَبَّانَ عَنْ عَمْرِو بْنِ سُلَيْمِ بْنِ خَلْدَةَ الأَنْصَارِيِّ

عَنْ أَبِي قَتَادَةَ صَاحِبِ رَسُولِ اللَّهِ ﷺ قَالَ دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللَّهِ ﷺ جَالِسٌ بَيْنَ ظَهْرَانَىِ النَّاسِ قَالَ فَجَلَسْتُ فَقَالَ رَسُولُ اللَّهِ ﷺ مَا مَنَعَكَ أَنْ تَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ قَالَ فَقُلْتُ يَا رَسُولَ اللَّهِ رَأَيْتُكَ جَالِسًا وَالنَّاسُ جُلُوسٌ قَالَ فَإِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلاَ يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ  


See similar narrations below:

Collected by Aḥmad, Bayhaqī
ahmad:22601Muʿāwiyah b. ʿAmr > Zāʾidah > ʿAmr b. Yaḥyá al-Anṣārī > Muḥammad b. Yaḥyá b. Ḥabbān > ʿAmr b. Sulaym b. Khaldah al-Anṣārī > Abū Qatādah

[Machine] I entered the mosque and the Messenger of Allah ﷺ was sitting amongst the people. So, I sat down. Then the Messenger of Allah ﷺ said, "What prevented you from praying two units (rak'ahs) before sitting down?" I replied, "I saw you sitting, and the people were also sitting." He said, "When one of you enters the mosque, they should not sit down until they have prayed two units (rak'ahs)."  

أحمد:٢٢٦٠١حَدَّثَنَا مُعَاوِيَةُ بْنُ عَمْرٍو حَدَّثَنَا زَائِدَةُ حَدَّثَنَا عَمْرُو بْنُ يَحْيَى الْأَنْصَارِيُّ حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى بْنِ حَبَّانَ عَنْ عَمْرِو بْنِ سُلَيْمِ بْنِ خَلْدَةَ الْأَنْصَارِيِّ عَنْ أَبِي قَتَادَةَ قَالَ

دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللهِ ﷺ جَالِسٌ بَيْنَ ظَهْرَيِ النَّاسِ فَجَلَسْتُ فَقَالَ رَسُولُ اللهِ ﷺ مَا مَنَعَكَ أَنْتَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ؟ قَالَ قُلْتُ إِنِّي رَأَيْتُكَ جَالِسًا وَالنَّاسُ جُلُوسٌ قَالَ وَإِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلَا يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ  

bayhaqi:5695Abū ʿAbdullāh al-Ḥāfiẓ > Abū ʿAmr b. Abū Jaʿfar > al-Ḥasan b. Sufyān > Abū Bakr b. Abū Shaybah > Ḥusayn b. ʿAlī > Zāʾidah > ʿAmr b. Yaḥyá al-Anṣārī > Muḥammad b. Yaḥyá b. Ḥabbān > ʿAmr b. Sulaym b. Khaldah al-Anṣārī

I entered the mosque, when the Messenger of Allah ﷺ had been sitting among people, and I also sat down among them. Upon this the Messenger of Allah ﷺ said: What prevented you from offering two rak'ahs (of Nafl prayer) before sitting down? I said: Messenger of Allah, I saw you sitting and people sitting (around you and I, therefore, sat in your company). He (the Holy Prophet) then said: When anyone among you enters the mosque, he should not sit till he has observed two rak'ahs. (Using translation from Muslim 714b)   

البيهقي:٥٦٩٥أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ أَخْبَرَنِي أَبُو عَمْرِو بْنُ أَبِي جَعْفَرٍ أنبأ الْحَسَنُ بْنُ سُفْيَانَ ثنا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ ثنا حُسَيْنُ بْنُ عَلِيٍّ عَنْ زَائِدَةَ قَالَ حَدَّثَنِي عَمْرُو بْنُ يَحْيَى الْأَنْصَارِيُّ حَدَّثَنِي مُحَمَّدُ بْنُ يَحْيَى بْنِ حَبَّانَ عَنْ عَمْرِو بْنِ سُلَيْمِ بْنِ خَلْدَةَ الْأَنْصَارِيِّ

عَنْ أَبِي قَتَادَةَ صَاحِبِ رَسُولِ اللهِ ﷺ قَالَ دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللهِ ﷺ جَالِسٌ بَيْنَ ظَهْرَانِي النَّاسِ قَالَ فَجَلَسْتُ فَقَالَ رَسُولُ اللهِ ﷺ مَا مَنَعَكَ أَنْ تَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ؟ قَالَ فَقُلْتُ يَا رَسُولَ اللهِ رَأَيْتُكَ جَالِسًا وَالنَّاسُ جُلُوسٌ قَالَ إِذَا دَخَلَ أَحَدُكُمُ الْمَجْلِسَ فَلَا يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ أَبِي بَكْرِ بْنِ أَبِي شَيْبَةَ