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.
tabarani:17747Isḥāq b. Ibrāhīm al-Ṣanʿānī > ʿAbd al-Razzāq > Ibn Jurayj > Yaḥyá b. ʿAmr > Abū ʿAmmār al-Anṣārī > Abū Zayd a freed slave of Thaʿlabah

[Machine] He informed him that Ma'qil ibn abi Maqil al-Asadi, a companion of the Prophet ﷺ, narrated to him: "The Messenger of Allah ﷺ forbade facing the two qiblas (Kaaba in Makkah and Masjid al-Aqsa in Jerusalem) while in a state of impurity (due to feces and urine)."  

الطبراني:١٧٧٤٧حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ الصَّنْعَانِيُّ عَنْ عَبْدِ الرَّزَّاقِ عَنِ ابْنِ جُرَيْجٍ أَخْبَرَنِي يَحْيَى بْنُ عَمْرٍو عَنْ أَبِي عَمَّارٍ الْأَنْصَارِيِّ أَنَّ أَبَا زَيْدٍ مَوْلَى ثَعْلَبَةَ

أَخْبَرَهُ أَنَّ مَعْقِلَ بْنَ أَبِي مَعْقِلٍ الْأَسَدِيَّ مِنْ أَصْحَابِ النَّبِيِّ ﷺ حَدَّثَهُ «أَنَّ رَسُولَ اللهِ ﷺ» نَهَى أَنْ تُسْتَقْبَلَ الْقِبْلَتَانِ بِالْغَائِطِ وَالْبَوْلِ  


See similar narrations below:

Collected by Ibn Mājah, Aḥmad
ibnmajah:319Abū Bakr b. Abū Shaybah > Khālid b. Makhlad > Sulaymān b. Bilāl > ʿAmr b. Yaḥyá al-Māzinī > Abū Zayd a freed slave of al-Thaʿlabiyyīn

"The Messenger of Allah forbade us from facing either of the two Qiblah when defecating or urinating."  

ابن ماجة:٣١٩حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ حَدَّثَنَا خَالِدُ بْنُ مَخْلَدٍ عَنْ سُلَيْمَانَ بْنِ بِلاَلٍ حَدَّثَنِي عَمْرُو بْنُ يَحْيَى الْمَازِنِيُّ عَنْ أَبِي زَيْدٍ مَوْلَى الثَّعْلَبِيِّينَ

عَنْ مَعْقِلِ بْنِ أَبِي مَعْقِلٍ الأَسَدِيِّ وَقَدْ صَحِبَ النَّبِيَّ ﷺ قَالَ نَهَى رَسُولُ اللَّهِ ﷺ أَنْ نَسْتَقْبِلَ الْقِبْلَتَيْنِ بِغَائِطٍ أَوْ بِبَوْلٍ  

ahmad:27292ʿAbd al-Razzāq > Ibn Jurayj > ʿAmr b. Yaḥyá al-Anṣārī > Abū Zayd a freed slave of Thaʿlabah

[Machine] He informed him about Maqil ibn Abi Maqil al-Ansari, one of the companions of the Prophet ﷺ. He narrated to him that the Prophet ﷺ forbade facing the Qibla (direction of prayer) when defecating or urinating.  

أحمد:٢٧٢٩٢حَدَّثَنَا عَبْدُ الرَّزَّاقِ قَالَ أَخْبَرَنَا ابْنُ جُرَيْجٍ قَالَ أَخْبَرَنِي عَمْرُو بْنُ يَحْيَى الْأَنْصَارِيُّ عَنْ أَبِي زَيْدٍ مَوْلَى ثَعْلَبَةَ

أَخْبَرَهُ عَنْ مَعْقِلِ بْنِ أَبِي مَعْقِلٍ الْأَنْصَارِيِّ مِنْ أَصْحَابِ النَّبِيِّ ﷺ حَدَّثَهُ أَنَّ النَّبِيَّ ﷺ نَهَى أَنْ تُسْتَقْبَلَ الْقِبْلَتَانِ لِلْغَائِطِ وَالْبَوْلِ