Praise be to Allah.
What appears to be the case is that the one who offers the funeral prayer, even if he did not come out with the bier from the house of the deceased, will have a qirat of reward, because of the report narrated by Muslim in his Sahih (945) from Abu Hurayrah (may Allah be pleased with him), from the Prophet (blessings and peace of Allah be upon him), who said: “Whoever offers the funeral prayer and does not follow (the bier) will have one qirat, and whoever follows it will have two qirats.” It was said: What are the two qirats? He said: “The smaller of them is like Uhud.”
And it was narrated from Thawban, the freed slave of the Messenger of Allah (blessings and peace of Allah be upon him), that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever offers the funeral prayer will have one qirat, and if he attends the burial he will have two qirat, each qirat like Uhud.” Narrated by Muslim (946).
Ibn Qudamah (may Allah have mercy on him) said: Following the bier is of three types:
- Offering the funeral prayer, then leaving.
- Following the bier to the grave, then remaining there until the deceased is buried.
- Remaining for a while after the burial and praying for forgiveness for the deceased."(Al-Mughni 2/174).
Al-Bahuti (may Allah have mercy on him) said: Ahmad was asked about someone who comes to the prayer place where funeral prayers are offered, and offers the funeral prayer with those who come. He said: There is nothing wrong with that… It says in al-Furu‘: It is as if he thought that if he followed the bier from the house of the deceased, that would have been better. It says in the hadith of Yahya ibn Ja‘dah: “And follow it from the house of the deceased,” meaning whoever offers the funeral prayer after following the bier from the house of the deceased will have one qirat."(Daqa’iq Uli’l-Nuha 1/367).
Al-Hafiz said in al-Fath: What this implies is that the qirat is only for the one who attends from the beginning until the end of the prayer. This was stated clearly by al-Muhibb al-Tabari and others. What appears to me to be the case is that the qirat may also be attained by one who attends the prayer only, because everything that comes before the prayer is a means that leads to it, but the qirat earned by the one who offers the prayer only will be less than the qirat of the one who walks with the bier, for example, and offers the prayer. The report narrated by Muslim via Abu Salih from Abu Hurayrah, which says “The smaller of them is like Uhud” indicates that the qirats vary. It also says in the report of Abu Salih that is narrated by Muslim: “The one who offers the funeral prayer but does not follow (the bier) will have one qirat.” According to the report narrated by Nafi ibn Jubayr from Abu Hurayrah, which is narrated by Ahmad: “Whoever offers the prayer but does not follow (the bier) will have one qirat.” This indicates that offering the prayer earns the qirat, even if one does not follow (the bier). It may be that what is meant by following (the bier) refers to what comes after the prayer."(Fath al-Bari 3/197).
And Allah knows best.