Sayyiduna Abu Ayyub al-Ansari (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) forbade us from facing the qiblah when relieving ourselves or urinating. Then, when we reached Syria (al-Sham), we found that the toilets there had been built facing the qiblah, so we turn away and seek forgiveness from Allah, the Mighty and Majestic.
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3906