The Prophet of Allah ﷺ, when he prayed over a deceased person, would say, "O Allah, forgive our living and our dead, those present among us and those absent, our males and our females, our young and our old."Yahya said, Abu Salama bin Abdul-Rahman also narrated this hadith to me from the Prophet ﷺ, and he added in it, "O Allah, whoever among us You keep alive, keep him alive upon Islam, and whoever You take in death, take him in death upon faith."
حدثنا عفان حدثنا أبان حدثنا يحيى بن أبي كثير
أن نبي الله ﷺ كان إذا صلى على الميت قال اللهم اغفر لحينا وميتنا وشاهدنا وغائبنا وذكرنا وأنثانا وصغيرنا وكبيرنا قال يحيى وحدثني أبو سلمة بن عبد الرحمن بهذا الحديث عن النبي ﷺ وزاد فيه اللهم من أحييته منا فأحيه على الإسلام ومن توفيته فتوفه على الإيمان