[Machine] The Prophet of Allah ﷺ used to say the following supplication when praying for the deceased: "O Allah, forgive our living and our dead, those who are present and those who are absent, our males and our females, our young and our old." Yahya said that Abu Salama bin Abdul Rahman narrated this hadith from the Prophet ﷺ and added: "O Allah, whoever of us you keep alive, let him live in Islam, and whoever of us you cause to die, let him die in faith."
أَنَّ نَبِيَّ اللهِ ﷺ كَانَ إِذَا صَلَّى عَلَى الْمَيِّتِ قَالَ اللهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَشَاهِدِنَا وَغَائِبِنَا وَذَكَرِنَا وَأُنْثَانَا وَصَغِيرِنَا وَكَبِيرِنَا قَالَ يَحْيَى وَحَدَّثَنِي أَبُو سَلَمَةَ بْنُ عَبْدِ الرَّحْمَنِ بِهَذَا الْحَدِيثِ عَنِ النَّبِيِّ ﷺ وَزَادَ فِيهِ اللهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الْإِسْلَامِ وَمَنْ تَوَفَّيْتَهُ فَتَوَفَّهُ عَلَى الْإِيمَانِ