Once I went upstairs in Hafsa's house and saw the Prophet (ﷺ) answering the call of nature with his back towards the Qibla and facing Sham.

Sahih al-Bukhari Book 57, Hadith 11