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.
tirmidhi:350Muḥammad b. Bashhār > Yaḥyá b. Saʿīd > Shuʿbah > Abū al-Tayyāḥ al-Ḍubaʿī > Anas b. Mālik

"The Prophet would perform Salat in sheep pens."  

الترمذي:٣٥٠حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ عَنْ شُعْبَةَ عَنْ أَبِي التَّيَّاحِ الضُّبَعِيِّ عَنْ أَنَسِ بْنِ مَالِكٍ

أَنَّ النَّبِيَّ ﷺ كَانَ يُصَلِّي فِي مَرَابِضِ الْغَنَمِ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ وَأَبُو التَّيَّاحِ الضُّبَعِيُّ اسْمُهُ يَزِيدُ بْنُ حُمَيْدٍ

See similar narrations below:

Collected by Muslim, Aḥmad, Ibn Ḥibbān, Suyūṭī
muslim:524bʿUbaydullāh b. Muʿādh al-ʿAnbarī from my father > Shuʿbah > Abū al-Tayyāḥ > Anas

The Messenger of Allah ﷺ used to pray in the folds of the sheep and goats before the mosque was built.  

مسلم:٥٢٤bحَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ الْعَنْبَرِيُّ حَدَّثَنَا أَبِي حَدَّثَنَا شُعْبَةُ حَدَّثَنِي أَبُو التَّيَّاحِ عَنْ أَنَسٍ

أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ يُصَلِّي فِي مَرَابِضِ الْغَنَمِ قَبْلَ أَنْ يُبْنَى الْمَسْجِدُ  

ahmad:12335Muḥammad b. Jaʿfar > Shuʿbah > Abū al-Tayyāḥ And Ḥajjāj > Shuʿbah > Abū al-Tayyāḥ > Anas b. Mālik

The Messenger of Allah ﷺ used to pray in the folds of the sheep and goats before the mosque was built. (Using translation from Muslim 524b)  

أحمد:١٢٣٣٥حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ حَدَّثَنَا شُعْبَةُ عَنْ أَبِي التَّيَّاحِ وَحَجَّاجٌ قَالَ سَمِعْتُ شُعْبَةَ عَنْ أَبِي التَّيَّاحِ قَالَ سَمِعْتُ أَنَسَ بْنَ مَالِكٍ يُحَدِّثُ

أَنَّ رَسُولَ اللهِ ﷺ كَانَ يُصَلِّي فِي مَرَابِضِ الْغَنَمِ قَبْلَ أَنْ يُبْنَى الْمَسْجِدُ  

ذِكْرُ جَوَازِ الصَّلَاةِ لِلْمَرْءِ عَلَى الْمَوَاضِعِ الَّتِي أَصَابَهَا أَبْوَالُ مَا يُؤْكَلُ لُحُومُهَا وَأَرْوَاثُهَا

ibnhibban:1385al-Faḍl b. al-Ḥubāb > Muḥammad b. Kathīr al-ʿAbdī > Shuʿbah > Abū al-Tayyāḥ > Anas b. Mālik

Anas said, "The Prophet ﷺ prayed in the sheep fold." Later on I heard him saying, "He prayed in the sheep folds before the construction of the, mosque." (Using translation from Bukhārī 429)  

ابن حبّان:١٣٨٥أَخْبَرَنَا الْفَضْلُ بْنُ الْحُبَابِ قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ كَثِيرٍ الْعَبْدِيُّ قَالَ أَخْبَرَنَا شُعْبَةُ عَنْ أَبِي التَّيَّاحِ عَنْ أَنَسِ بْنِ مَالِكٍ قَالَ

«كَانَ النَّبِيُّ ﷺ يُصَلِّي فِي مَرَابِضِ الْغَنَمِ»