People say that when you sit to relieve yourself, you should not face the qiblah. Yet one day I climbed onto the roof of our house and saw the Messenger of Allah ﷺ sitting on two bricks, facing Bayt al-Maqdis. This is the wording of Yazid bin Harun's narration.
حدثنا هشام بن عمار حدثنا عبد الحميد بن حبيب حدثنا الأوزاعي حدثني يحيى بن سعيد الأنصاري ح و حدثنا أبو بكر بن خلاد ومحمد بن يحيى قالا حدثنا يزيد بن هارون أنبأنا يحيى بن سعيد أن محمد بن يحيى بن حبان أخبره أن عمه واسع بن حبان أخبره أن
يقول أناس إذا قعدت للغائط فلا تستقبل القبلة ولقد ظهرت ذات يوم من الأيام على ظهر بيتنا فرأيت رسول الله ﷺ قاعدا على لبنتين مستقبل بيت المقدس هذا حديث يزيد بن هارون
Bukhari transmitted it in Wudu, chapter on relieving oneself in houses, hadith 149, from the report of Yazid bin Harun and others, and Muslim in Purification, chapter on cleansing oneself after relieving oneself, hadith 266, from the report of Yahya bin Saeed through the same chain.