Al-Imām al-Bukhārī - upon whom be mercy - narrates: Ibrāhīm ibn al-Mundhir related to us; he said: Anas ibn ‘Iyāḍ related to us, from ‘Ubaydullāh, from Muḥammad ibn Yaḥyā ibn Ḥibbān, from Wāsi’ ibn Ḥibbān,
that ‘Abdullāh ibn ‘Umar - may Allāh Almighty be content with both of them - said: I once went up onto the roof of the house of our mother Ḥafṣah - may Allāh Almighty be content with her - for some need of mine, and I saw the Messenger of Allah ﷺ relieving himself. His back was toward the Qiblah, and his face was toward Shām.
Reference: Sahih Al Bukhari 148