Narrated `Abdullah
We used to greet the Prophet (ﷺ) while he was praying and he used to answer our greetings. When we returned from An-Najashi (the ruler of Ethiopia), we greeted him, but he did not answer us (during the prayer) and (after finishing the prayer) he said, "In the prayer one is occupied (with a more serious matter)."
Narrated Zaid bin Arqam
In the lifetime of the Prophet (ﷺ) we used to speak while praying, and one of us would tell his needs to his companions, till the verse, 'Guard strictly your prayers (2.238) was revealed. After that we were ordered to remain silent while praying.