كتاب السلام
39  
The Book of Greetings
(3)
Chapter: One Of The Rights Of One Muslim Over Another Is (The Greeting Of) Salam
(3)
باب مِنْ حَقِّ الْمُسْلِمِ لِلْمُسْلِمِ رَدُّ السَّلاَمِ ‏‏
Sahih Muslim 2162 b

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

Six are the rights of a Muslim over another Muslim. It was said to him: Allah's Messenger, what are these? Thereupon he said: When you meet him, offer him greetings;when he invites you to a feast accept it. when he seeks your council give him, and when he sneezes and says:" All praise is due to Allah," you say Yarhamuk Allah (may Allah show mercy to you) ; and when he fails ill visit him; and when he dies follow his bier.
حَدَّثَنَا يَحْيَى بْنُ أَيُّوبَ، وَقُتَيْبَةُ، وَابْنُ، حُجْرٍ قَالُوا حَدَّثَنَا إِسْمَاعِيلُ، - وَهُوَ ابْنُ جَعْفَرٍ - عَنِ الْعَلاَءِ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏ حَقُّ الْمُسْلِمِ عَلَى الْمُسْلِمِ سِتٌّ ‏"‏ ‏.‏ قِيلَ مَا هُنَّ يَا رَسُولَ اللَّهِ قَالَ ‏"‏ إِذَا لَقِيتَهُ فَسَلِّمْ عَلَيْهِ وَإِذَا دَعَاكَ فَأَجِبْهُ وَإِذَا اسْتَنْصَحَكَ فَانْصَحْ لَهُ وَإِذَا عَطَسَ فَحَمِدَ اللَّهَ فَسَمِّتْهُ وَإِذَا مَرِضَ فَعُدْهُ وَإِذَا مَاتَ فَاتَّبِعْهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 2162b
In-book reference : Book 39, Hadith 6
USC-MSA web (English) reference : Book 26, Hadith 5379
  (deprecated numbering scheme)