Hadithcore
Sahih al-Bukhari, 532
sahih

Narrated Anas:

The Prophet (ﷺ) said, "Do the prostration properly and do not put your forearms flat with elbows touching the ground like a dog. And if you want to spit, do not spit in front, nor to the right for the person in prayer is speaking in private to his Lord."

حَدَّثَنَا حَفْصُ بْنُ عُمَرَ، قَالَ حَدَّثَنَا يَزِيدُ بْنُ إِبْرَاهِيمَ، قَالَ حَدَّثَنَا قَتَادَةُ، عَنْ أَنَسٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏

‏ اعْتَدِلُوا فِي السُّجُودِ، وَلاَ يَبْسُطْ ذِرَاعَيْهِ كَالْكَلْبِ، وَإِذَا بَزَقَ فَلاَ يَبْزُقَنَّ بَيْنَ يَدَيْهِ وَلاَ عَنْ يَمِينِهِ، فَإِنَّهُ يُنَاجِي رَبَّهُ ‏

‏‏.‏

References2 variants
In-Book Reference
Book 9, Hadith 11
USC-MSA web (English) reference
Vol. 1, Book 10, Hadith 509 (deprecated numbering scheme)
Sharh · explanationclick to expand
The Prophet (blessings and peace of Allah be upon him) used to teach his companions (may Allah be pleased with them) how to pray, and the etiquette and sunnahs of prayer. In this hadith, the Prophet (blessings and peace of Allah be upon him) instructs the Muslim to prostrate properly when praying, by resting on his feet (toes), knees, hands and face. The worshipper should not rest his forearms on the ground when prostrating, as a dog rests, which means placing the hands and the elbows on the ground. Then the Prophet (blessings and peace of Allah be upon him) forbade spitting – which means ejecting mucus from the mouth or nose – whilst praying or whilst one is in the mosque. Thus he forbade the worshipper to spit in front of him, which is the direction of the qiblah, or to spit to his right, because that is the honourable side, and all honourable actions are started on the right. That is because the person – whether he is praying or is in the mosque – is standing before his Lord, so he must adhere to proper etiquette and not do anything that it is not appropriate to do before Him (may He be glorified and exalted). Other reports explain that the Prophet (blessings and peace of Allah be upon him) instructed the worshipper, if he cannot help but spit, to spit to his left or under his foot, in order to bury it, or to spit into the edge of his garment if he cannot spit in any of those directions. The Muslim should take precautions to avoid contaminating the mosque with spittle on the ground, especially if the mosque is carpeted, and he is able to use a handkerchief or the edge of his garment to spit into if he is praying. But if he is not praying, then he can exit the mosque and go somewhere else where he can clean his mouth and nose. This comes under the heading of proper etiquette and respecting the mosque..