Visiting the Prophet’s Masjid
A pilgrim should go to Madeenah before or after Hajj with the intention of visiting the Prophet’s Masjid and praying in it.27

Prayer in his Masjid is better than a thousand prayers elsewhere except in the Holy Masjid in Makkah.

Upon reaching the Masjid, he should pray two Rak‘ahs of salutation or perform any obligatory prayer that is due.

He should go to the grave of the Prophet (Peace be upon him) and stand before it.

He greets him saying:
«... السلام عليك ورحمة الله وبركاته يا نبي الله»
“May the peace, mercy, and blessings of Allah be upon you, O Prophet. May Allah grant you a good reward on behalf of your people.”

He takes a step or two to his right to position himself before Abu Bakr and greets him saying:
«... السلام عليك ورحمة الله وبركاته يا خليفة رسول الله»
“May the peace, mercy, and blessing of Allah be upon you, O Abu-Bakr, Khaleefah the Messenger of Allah (Peace be upon him).
----------------------------------------------
27 A common practice amongst people is that they proceed to Madeenah with the intention of visiting the grave of the Prophet (Peace be upon him), which is not permissible. One should have the intention of visiting and praying in the Prophet’s (Peace be upon him) masjid, and while he is there for that reason, he should visit his grave and greet him with greetings of Salaam.
----------------------------------------------

May Allah be pleased with you and grant you a good reward on behalf of Muhammad’s people.”

Then he takes a step or two to his right to position himself before ‘Umar and greets him saying:
«... السلام عليك ورحمة الله وبركاته يا أمير المؤمنين»
“May the peace, mercy and blessings of Allah be upon you, O ‘Umar, Ameer-ul-Mu´minoon.28 May Allah be pleased with you and grant you a good reward on behalf of Muhammad’s people.”

In a state of purity, he should go to pray in Masid al-Qubaa´.

He should go to al-Baqee’ to visit ‘Uthman’s grave (May Allah be pleased with him). He should stand before it and greet him saying:
«... السلام عليك ورحمة الله وبركاته يا أمير المؤمنين»
“May the peace, mercy and blessing of Allah be upon you, O ‘Uthmaan, Ameer-ul-Mu´minoon. May Allah be pleased with you and grant you a good reward on behalf of Muhammad’s people.”

He greets any other Muslims in al-Baqee’.

He proceeds to the mountain of Uhud and visits the grave of Hamzah (May Allah be pleased with him) and the other martyrs there with him. He greets
-----------------------------------------
28 Ameer-ul-Mu´minoon: The Leader of the Believer, the title given to the Khaleefah.
-----------------------------------------

them and prays to Allah to grant them forgiveness, mercy, and pleasure.