What are the rules of visiting the mosque of Prophet Muhammad (Peace and blessing be upon him)?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Visiting the mosque of the Prophet Muhammad is a desirable act for the Prophet said: “Do not set out on a journey except for three mosques: Al-Masjid Al-Haraam, my Mosque (in Medeenah), and Al-Aqsa Mosque (in Jerusalem).” [Al-Bukhari and Muslim]
Imam An-Nawawi said: “The above Hadeeth establishes the virtues of these three mosques and emphasizes visiting them.” When one visits the Prophet's mosque, he should take in consideration the following rules:
1. After visiting that mosque, one should also visit the grave of the Prophet Muhammad . The majority of the Muslim scholars are of the opinion that visiting his grave is a legal act. Ibn Hajar said that visiting the grave of the Prophet is among great and significant acts; all the Muslim scholars have agreed upon its permissibility. A similar statement is also reported from Qadhi Iyadh.
2. One should also keep performing prayers in congregation at the Prophet's mosque in order to get the high reward as the Prophet said: “Prayer in my mosque is better than a thousand prayers observed in other mosques except the Al-Haraam mosque (i.e. the Holy mosque in Makkah.” [Al-Bukhari and Muslim]
3. It is also recommended that when one visits the grave of the Prophet to also send greetings to the two companions of the Prophet; i.e., Abu Bakr and ‘Umar who are buried beside him.
4. Making crowd and hurrying to get together at the grave of the Prophet Muhammad is disliked. Imam An-Nawawi said: “Kissing or touching the wall of the grave of the Prophet with one’s hands, stomach, back and making circumambulation to it is forbidden. One should be far from the grave, as he would do if he were in the Prophet's lifetime.” What we have mentioned here are the authentic rules, though many people violate them and practice many innovations. You should not be lured by their acts. A Muslim should adhere only to the teachings of the Quran and Sunnah.
For more benefit on the reward for praying in the two Holy Mosques, please refer to Fataawa 190553 and 88852.
Allah knows best.
You can search for fatwa through many choices