Whenever the Messenger of Allah ﷺ prayed over a deceased person, he would say, "Allah, forgive our living and our dead, those present among us and those absent, our young and our old, our males and our females. Allah, whomever You keep alive from among us, keep him alive upon Islam, and whomever You take from among us, take him upon faith."
حدثنا خلف بن الوليد قال حدثنا أيوب بن عتبة عن يحيى بن أبي كثير عن أبي سلمة
كان رسول الله ﷺ إذا صلى على الجنازة قال اللهم اغفر لحينا وميتنا وشاهدنا وغائبنا وصغيرنا وكبيرنا وذكرنا وأنثانا اللهم من أحييته منا فأحيه على الإسلام ومن توفيته منا فتوفه على الإيمان