Sahih Muslim, Book 2, Hadith 73 (Muslim 603)

Salman reported that it was said to him:

Your Apostle (ﷺ) teaches you about everything, even about excrement. He replied: Yes, he has forbidden us to face the Qibla at the time of excretion or urination, or cleansing with right hand or with less than three pebbles, or with dung or bone.