Abdullah bin Umar reported,

One day I climbed onto the roof of Hafsah's house and saw the Prophet ﷺ relieving himself, facing Sham with his back to the Kaabah.

Tirmidhi 11

Sahih

حدثنا هناد حدثنا عبدة بن سليمان عن عبيد الله بن عمر عن محمد بن يحيى بن حبان عن عمه واسع بن حبان

عن ابن عمر قال

رقيت يوما على بيت حفصة فرأيت النبي ﷺ على حاجته مستقبل الشام مستدبر الكعبة

الترمذي 11صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Purification
Chapter
Concession regarding that
Numbering
Darussalam 11
Tirmidhi 11