He had been a companion of the Prophet ﷺ. He said, "The Messenger of Allah ﷺ forbade us from facing either of the two qiblahs while relieving ourselves or urinating."
حدثنا أبو بكر بن أبي شيبة حدثنا خالد بن مخلد عن سليمان بن بلال حدثني عمرو بن يحيى المازني عن أبي زيد مولى الثعلبيين
وقد صحب النبي ﷺ قال نهى رسول الله ﷺ أن نستقبل القبلتين بغائط أو ببول
Sourcing, its chain is daif. Abu Dawud narrated it in the Book of Purification, Chapter on the Dislike of Facing the qibla When Relieving Oneself, hadith no. 10, from the hadith of Amr, through this route. Abu Zayd is unknown (majhul), as stated in Taqrib and other sources.