According to Hadith reports, here is what is reported to have happened:
[http://www.al-mawrid.org/pages/articles_english_detail.php?rid=159&cid=53]:
vi. During the Qa'dah
The qa'dah (sitting after completing the prostrations) of the prayer is reserved for supplications, and a person can say whatever supplication he wants to. The guidance provided by the practice of the Prophet (sws) in this regard is detailed out below:
1. 'Abdullāh Ibn Mas'ūd (rta) says that when we would pray with the Prophet (sws), we would say: 'Peace be to God from His servants and peace be to such and such persons'. When the Prophet (sws) heard this, he said: 'Don't say: 'Peace be to God', for God Himself is entirely peace. Say this instead:التَّحِيَّاتُ لِلَّهِ وَالصَّلَوَاتُ وَالطَّيِّبَاتُ السَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللَّهِ وَبَرَكَاتُهُ السَّلَامُ عَلَيْنَا وَعَلَى عِبَادِ اللَّهِ الصَّالِحِينَ (All salutations, supplications and good deeds are for God. Peace be to you O Messenger of God, and blessings and mercy. Peace be to us also and to all pious people too). If you say these words, your supplication will reach every person who is in the sky or is found somewhere between the sky and the earth. [He further said:]أَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ (I bear witness that there is no god except Allah and I bear witness that Muḥammad (sws) is His servant and messenger). After this, a person can say any supplication he wants to for himself.[51]
With slight variations, the above supplication is also reported by 'Umar (rta), 'A'ishah (rta), 'Abdullāh Ibn 'Umar (rta), 'Abdullāh Ibn 'Abbās (rta) and Abū Mūsā 'Ash'arī (rta).[52] It is evident from the narratives that after this, the Prophet (sws) would diligently teach this supplication to his Companions (rta).[53]
2. Abū Mas'ūd (rta) narrates: 'We were sitting at the place of Sa'd Ibn 'Ubādah (rta). When the Prophet (sws) came over, Bashīr Ibn Sa'd (rta) asked: 'O Messenger of God! God has directed us to send blessings on you; please let us know how we should do this?' At this, the Prophet (sws) kept silent and we wished that we had not asked this question. He then said: 'You should say:
اللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ وَعَلَى آلِ مُحَمَّدٍ كَمَا صَلَّيْتَ عَلَى آلِ إِبْرَاهِيمَ وَبَارِكْ عَلَى مُحَمَّدٍ وَعَلَى آلِ مُحَمَّدٍ كَمَا بَارَكْتَ عَلَى آلِ إِبْرَاهِيمَ فِي الْعَالَمِينَ إِنَّكَ حَمِيدٌ مَجِيدٌ
O God! be merciful to Muhammad and his clan the way you have been merciful to Abraham and his clan and send Your blessings on Muhammad and his clan the way you have sent Your blessings on Abraham and his clan in this whole world. Indeed, You are great and possess all worthy attributes.''[54]
There are some variations in the words of this supplication; however, by and large, the theme is the same. It is also narrated that the Prophet (sws) has said about the darūd: 'A person who sends mercy on me once, the Almighty will send mercy on him ten times.'[55]
The Qur'ānic directive referred to in the narrative is:
إِنَّ اللَّهَ وَمَلَائِكَتَهُ يُصَلُّونَ عَلَى النَّبِيِّ يَا أَيُّهَا الَّذِينَ آمَنُوا صَلُّوا عَلَيْهِ وَسَلِّمُوا تَسْلِيمًا
The Prophet is blessed by God and His angels. Bless him, then, you who are true believers, and greet him with a worthy salutation. (33:56)