Narrated Anas bin Malik
The Prophet (ﷺ) said, "A faithful believer while in prayer is speaking in private to his Lord, so he should neither spit in front of him nor to his right side but he could spit either on his left or under his foot."
Narrated Abu Sa`id
The Prophet (ﷺ) saw sputum on (the wall of) the mosque in the direction of the Qibla and scraped it off with gravel. Then he forbade Spitting in front or on the right, but allowed it on one's left or under one's left foot.