Sheikh Hânî al-Jubayr, judge at the Jeddah Supreme Court
If a man divorces his wife while she is pregnant, the divorce will be in accordance with what the Sunnah dictates to be a valid divorce. When Ibn `Umar divorced his wife during her menstrual cycle, the Prophet (peace be upon him) corrected him and said: “Divorce during a state of purity or during a pregnancy.” [Sahîh al-Bukhârî (4908) and Sahîh Muslim (1471)]
As for the waiting period (`iddah) of a woman who is divorced during her pregnancy, it will continue until the time that the child is delivered.
In the case of a miscarriage, then it must be determined whether or not the fetus has taken on the characteristics of a human form. If the fetus shows such characteristics as the shape of a hand or a foot, even slightly, then the woman will be considered to be legally in her period of post-natal bleeding (nifâs) and her `iddah will be over.
If, on the other hand, no human form can be discerned, but there is merely an unformed lump flesh or what resembles a clot of blood, then this will not cause her `iddah to come to an end, since the blood will not be legally construed as post-natal bleeding. She must complete her `iddah as three menstrual cycles.
The decisive factor is the advancement of the physical form of the fetus and not whether the soul has been breathed into it.
And Allah knows best.
Source: Islam Today