That he (the Holy Prophet, sal Allahu alayhi wa sallam) said:"When you go to the privy, neither turn your face nor your back towards the qiblah at the time of excretion or urination, but turn towards the east or the west. (Abu Ayyub said): When we came to Syria, we found that the toilets already built there were facing the qiblah, We turned our faces away from them and begged pardon of Allaah.
Reference: Sunan Abi Dawud 9 In-book : Book 1, Hadith 9 English translation : Book 1, Hadith 9
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.