It was narrated that Abdullah bin Mas'ud said:
I used to come to the Prophet (ﷺ) when he was praying, and I would greet him with Salam, he would return my greeting. Then I came to him when he was praying, and he did not return my greeting. When he said the Taslim, he pointed to the people and said: Allah (SWT) has decreed that in the prayer you should not speak except to remember Allah (SWT), and it is not appropriate for you, and that you should stand before Allah (SWT) with obedience.'