It is narrated from Abdullah bin Umar (may Allah be pleased with them both), he said: "Some people say that when you sit to relieve yourself, your face should not be towards the Qiblah or Bayt al-Maqdis." Abdullah bin Umar (may Allah be pleased with them both) said: "I climbed onto the roof of my house and I saw the Messenger of Allah (ﷺ) sitting on two bricks, facing Bayt al-Maqdis to relieve himself."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 36
Hadith Takhrijأخرجه البخاري: الوضوء، باب من تبرز على لبنتين (145)، ومسلم: الطهارة، باب الاستطابة (266).