The Messenger of Allah ﷺ said, "When one of you sits to relieve himself, he should neither face the qiblah nor turn his back to it."
أن رسول الله ﷺ قال: إذا جلس أحدكم على حاجته فلا يستقبل القبلة ولا يستدبرها.
Muslim narrated it in the Book of Purification (265), abridged, in this manner, via Suhayl, from Qaqa bin Hakeem, from Abu Salih, from Abu Hurairah, and he mentioned it.Abu Dawud (8) and Ibn Majah (313) narrated it via Ibn Ajlan, from Qaqa bin Hakeem, at greater length, and it includes, "I am to you like a father, teaching you. So when one of you goes to relieve himself, let him not face the qibla nor turn his back to it, and let him not cleanse himself with his right hand." He used to command the use of three stones, and he forbade the use of dung and bones.Nasai also recorded it, abridged.This chain is hasan, because it contains Ibn Ajlan, who is truthful."Rimma" means decayed bones.