G-4.3
The person best suited to lead the funeral prayer as imam is the one who is best suited to wash the deceased (dis:g-2.2) except for women, who have no right to lead (dis:f-12.27). The family member responsible for the deceased is given preference in leading the prayer even over the sultan (O: or imam of the mosque).
The older of two persons (O: meaning more years in Islam, provided he is upright (def:o-24.4) ) takes precedence over the more learned in Sacred Law (O: when they are at the same level (n: of the g-2.2 precedence order), such as two sons or two brothers, since the purpose is to pray for the deceased, and the supplication of an older person is more likely to be answered) and (n: the older) is given precedence over any others (A: at that level), though if they are of the same age, then one is chosen according to the order used for the imamate of other prayers(def:f-12.25).
The responsible family member is given precedence in leading the funeral prayer even when the deceased has stipulated some other nonfamily member to be the imam.
PLACING THE BODY FOR THE FUNERAL PRAYER