The Prophet ﷺ said, "The Muslim has six rights upon his fellow Muslim."Someone asked, "What are they, Messenger of Allah?"He replied, "When you meet him, greet him with peace. When he invites you, accept his invitation. When he seeks your advice, give him sincere counsel. When he sneezes and praises Allah, say 'May Allah have mercy on you.' When he falls ill, visit him. And when he dies, follow his funeral procession."
حدثنا سليمان قال حدثنا إسماعيل قال أخبرني العلاء عن أبيه
أن النبي ﷺ قال حق المسلم على المسلم ست قيل ما هي يا رسول الله قال إذا لقيته فسلم عليه وإذا دعاك فأجبه وإذا استنصحك فانصح له وإذا عطس فحمد الله فشمته وإذا مرض فعده وإذا مات فاتبعه
Its isnad is sahih. It was mentioned previously with the wording of five, in 8378. Bukhari 2/90 narrated it with similar wording in the Book of Funerals, chapter on the command to follow funeral processions, and Muslim 4/1704, number 2162, in the Book of Greetings, chapter on the right of the Muslim over the Muslim to return the greeting.