Language:
كتاب العمل فى الصلاة
21  
Actions while Praying
(15)
Chapter: One should not return greetings during the Salat
(15)
باب لاَ يَرُدُّ السَّلاَمَ فِي الصَّلاَةِ
Sahih al-Bukhari 1216

Narrated `Abdullah:

I used to greet the Prophet (ﷺ) while he was in prayer and he would return my greeting, but when we returned (from Ethiopia) I greeted the Prophet (while he was praying) but he did not return the greeting, and (after finishing the prayer) he said, "In the prayer one is occupied (with a more serious matter)."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا ابْنُ فُضَيْلٍ، عَنِ الأَعْمَشِ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، قَالَ كُنْتُ أُسَلِّمُ عَلَى النَّبِيِّ صلى الله عليه وسلم وَهُوَ فِي الصَّلاَةِ فَيَرُدُّ عَلَىَّ، فَلَمَّا رَجَعْنَا سَلَّمْتُ عَلَيْهِ فَلَمْ يَرُدَّ عَلَىَّ وَقَالَ ‏ "‏ إِنَّ فِي الصَّلاَةِ شُغْلاً ‏"‏‏.‏
Reference : Sahih al-Bukhari 1216
In-book reference : Book 21, Hadith 20
USC-MSA web (English) reference : Vol. 2, Book 22, Hadith 307
  (deprecated numbering scheme)