If many funerals come together
Whether they are of men and women, one prayer may be offered for all of them. It is also better to place the men’s bodies towards the imam and the women’s bodies towards the qiblah.
It is narrated from Ibn Umar (may Allah be pleased with them both) that:
انه صلى على تسع جنائز جميعا فجعل الرجال يلون الإمام والنساء يلين القبلة
“He prayed the funeral prayer for nine (9) bodies together, and he placed the men close to the imam and the women close to the qiblah.”
It is narrated from Ammar, the freed slave of Harith bin Nawfal, that Ibn Abbas (may Allah be pleased with him), Abu Sa’id (may Allah be pleased with him), Abu Qatadah (may Allah be pleased with him) and Abu Hurayrah (may Allah be pleased with him) were once asked about a similar situation in the funeral prayer, and they replied:
هذه السنة
“This is the sunnah way.”
◈ It should also be remembered that it is likewise correct to pray a separate funeral prayer for each of many bodies, because this is the original practice, just as the Prophet ﷺ did the same with the bodies of the martyrs of Uhud.