The Messenger of Allah ﷺ forbade us from facing either of the two qiblahs while urinating or defecating.
حدثنا موسى بن إسمعيل حدثنا وهيب حدثنا عمرو بن يحيى عن أبي زيد
نهى رسول الله ﷺ أن نستقبل القبلتين ببول أو غائط
[Its chain is daif] Ibn Majah narrated it in the Book of Purification, Chapter on the Prohibition of Facing the Qibla While Urinating or Defecating, h: 319, from the hadith of Amr bin Yahya, through him.Busiri said in Zawaid, "Abu Zayd's status is unknown, so the hadith is daif because of him," and Hafiz (Ibn Hajar) declared it daif in Fath al-Bari.