Sulaiman bin Buraidah narrates from his father: Whenever the Prophet Muhammad (peace be upon him) would visit the graveyard, he would teach the people to say this: "Peace be upon the inhabitants of the dwellings, the believers and the Muslims. If Allah wills, we shall join you. You have preceded us and we shall follow you. We ask Allah for well-being for ourselves and for you."
Hadith Referenceصحیح ابن حبان / كتاب الجنائز وما يتعلق بها مقدما أو مؤخرا / 3173
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الأحكام» (ص 240): م.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط مسلم