Al-Salâm `alaikum dâr qawmin mu’minîn wa inna in shâ’a Allah bikum lâhikûnAlso,in Sahîh Muslim reported by `Aishah, the Prophet (peace be upon him) taught Muslims to say when they visit the cemetery :
(Peace be upon you, believing denizens of the grave. Allah willing, we sahll one day be joining you.)
Al-Salâm `Alâ ahl al-Diyâr min al-mu’minîn wa al-muslimîn wa yarham Allah al-mustaqdimîn minnâ wa al-mustakhirîn wa innâ inshâ’ Allah bikum lalahikûn.One more text was mentioned in the hadîth related by Buraydah, who said:
(Peace be upon you, believing and Muslim denizens of the grave. May Allah have mercy one those of us who have already passed beyond and those who are still to do so. Allah willing, we shall one day be joining you.)
The Prophet (peace be upon him) used to teach them when they visit graveyards what to say. They would say “Al-Salâm `ala ahl al-Diyar” and in another context “Al-Salâm `alaykum ahl al-Diyar min al-mu’minîn wal-muslimîn wa innâ inshâ’ Allah la lâhikûn, As’al Allah lanâ walakum al-`âfiyah”.Any of these forms of supplication may be used. It is preferable to use them all on different occasions.
(The additional phrase here is: "We ask Allah for what is good, for you and for ourselves."