Praise be to Allah.
The scholars are unanimously agreed that the ‘iddah of a divorced woman who is pregnant ends when the pregnancy ends, because Allah, may He be exalted, says (interpretation of the meaning):
“And for those who are pregnant, their term is until they give birth”
They are also unanimously agreed that if a woman miscarries a foetus in which human features can be distinguished, her ‘iddah ends thereby. (al-Mughni, 11/229). The foetus begins to take shape after eighty days of pregnancy, and that can usually be clearly seen after ninety days.
Based on that, in the case of a woman who had a miscarriage when she was five months pregnant, her ‘iddah comes to an end thereby, according to all the scholars. So her husband has no right to take her back after the end of her ‘iddah.
But he may make a new marriage contract with her, if they both want that, but it is essential that it be done with her consent and in the presence of her guardian and two witnesses, and there should be a mahr (dowry).
There are two other issues that must be noted in the case of this man who caused the miscarriage:
He must offer expiation for accidental killing, which is the freeing of a believing slave. If that is not possible, then he must fast for two consecutive months, because Allah, may He be exalted, says (interpretation of the meaning):
“And whoever kills a believer by mistake - then the freeing of a believing slave and a compensation payment presented to the deceased’s family [is required] unless they give [up their right as] charity. … And whoever does not find [a slave or cannot afford to buy one] - then [instead], a fast for two months consecutively, [seeking] acceptance of repentance from Allah. And Allah is ever Knowing and Wise”
He must pay the diyah [blood money] for the foetus, which is one tenth of the diyah of the mother. The diyah of a Muslim woman is fifty camels, which now is equivalent to 60,000 Saudi riyals. So the father must give 6,000 Saudi riyals – or its equivalent in another currency – to the heirs of the foetus, which is to be divided among them as if the foetus had died and left that money behind. The father is not entitled to inherit any part of it, because the killer cannot inherit from the one whom he killed. Ibn Qudaamah said: If the offender who caused the miscarriage of the foetus was his father or another of his heirs, then he must pay the penalty [which is a male or female slave, the value of which is five camels, and we have noted above that it is equivalent now to 6,000 Saudi riyals], of which he does not inherit anything, and he must free a slave. This is the view of az-Zuhri, ash-Shaafa‘i and others. End quote.
And Allah knows best. May Allah send blessings and peace upon our Prophet Muhammad.