This excerpt is taken from the book of Sheikh al-Islam Imam Ibn Taymiyyah, may Allah have mercy on him, Al-Jawab al-Bahir fi Zuwar al-Maqabir, translated by Sheikh Ataullah Saqib.
The one who sends salutations upon the blessed grave receives a response
Some companions, like Abdullah ibn Umar رضي الله عنهما, when returning to Madinah Munawwarah from a journey, would greet the Prophet صلی اللہ علیہ وآلہ وسلم with salam. It was also the habit of the companions رضي الله عنهم that during the blessed life of the Prophet صلی اللہ علیہ وآلہ وسلم, when they came to his presence, they would offer salam and then leave the mosque; they did not do this at every prayer time. The blessed habit of the Prophet صلی اللہ علیہ وآلہ وسلم was that whoever said salam, he would respond to them. Even now, whoever goes near the honored grave and offers salam, the Prophet صلی اللہ علیہ وآلہ وسلم responds to them.
When the companions رضي الله عنهم would visit the presence of Umm al-Mu'minin Aisha رضي الله عنها, they would offer salam upon the Messenger of Allah صلی اللہ علیہ وآلہ وسلم in the same manner as they used to during his lifetime. The companions رضي الله عنهم used to offer salam in these words:
السلام على النبى ورحمة الله وبركاته
"Peace be upon the Messenger of Allah صلی اللہ علیہ وآلہ وسلم, and may Allah's mercy and blessings be upon him."
Every believer receives a response when greeting the grave
It is common to go and greet the graves of all believers. However, when a person comes to the grave of someone he knew in life and greets him, Allah Almighty returns the soul of the deceased to his body, and he responds to the one who greeted him.
Reference: (Reported by Ibn Abd al-Barr in Al-Tamhid wa Al-Istidhkar 185/1, as in Sharh al-Sudur by Al-Suyuti p. 202, and Al-Hafiz Ibn Rajab said: Ibn Abd al-Barr reported it and Abdul Haq al-Ishbili said: Its chain is authentic, indicating that all its narrators are trustworthy, and it is so, but it is strange and even rejected. Awhaal al-Quboor: 141, also see Tarikh Dimashq by Ibn Asakir 249/10, and Mizan al-I'tidal by Al-Dhahabi 525/2)
This narration is weak; in its chain, Abdul Rahman ibn Zaid is a neglected narrator, and he reports fabricated narrations from his father, as Imam Hakim mentioned in Al-Madkhal p. 104. And Allama Al-Albani, may Allah have mercy on him, mentioned it in Silsilat al-Ahadith al-Da'ifah wa al-Mawdu'ah, number 3493. Abdul Haq al-Ishbili's ruling of its chain as authentic is not correct. Hafiz Ibn Rajab, may Allah have mercy on him, refuted this and declared it rejected. (Mubashir Ahmad Rabbani)
This narration is weak; in its chain, Abdul Rahman ibn Zaid is a neglected narrator, and he reports fabricated narrations from his father, as Imam Hakim mentioned in Al-Madkhal p. 104. And Allama Al-Albani, may Allah have mercy on him, mentioned it in Silsilat al-Ahadith al-Da'ifah wa al-Mawdu'ah, number 3493. Abdul Haq al-Ishbili's ruling of its chain as authentic is not correct. Hafiz Ibn Rajab, may Allah have mercy on him, refuted this and declared it rejected. (Mubashir Ahmad Rabbani)
Therefore, it is established that when a believer's grave is greeted, his soul returns and he responds, then the Imam of the Prophets and the best of creation will certainly respond.