Abu Ayub reported,

The Messenger of Allah ﷺ said, "When one of you goes to relieve himself, he should neither face the qiblah nor turn his back to it. Face east or west instead."

Bukhari 144

Sahih

حدثنا آدم قال حدثنا ابن أبي ذئب قال حدثنا الزهري عن عطاء بن يزيد الليثي

عن أبي أيوب الأنصاري قال

قال رسول الله ﷺ إذا أتى أحدكم الغائط فلا يستقبل القبلة ولا يولها ظهره شرقوا أو غربوا

البخاري 144صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Wudu
Chapter
Do not face the qibla when relieving oneself except when there is a wall or something similar
Numbering
Darussalam 144
Bukhari 144