It is narrated from Sayyiduna Abu Ayyub (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Do not face the qiblah nor turn your back towards it when relieving yourselves or urinating; rather, face east or west."
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3902