It is good to note that the blood that is discharged after a miscarriage depends upon the status of the fetus. If the fetus was not shaped or the soul had not yet been breathed into it, then this blood is not considered nifas and thus, you have to wash it off, perform wudu’  (ablution) and pray. However, if the fetus was shaped or the soul was breathed into it, whether it was miscarried dead or alive, this blood is considered nifas and you should not pray till it stops. The creation and formation of the fetus, i.e., the appearance of human features, becomes apparent after eighty days after conception, as stated in the following hadith:

The Prophet (peace and blessings be upon him) saidThe creation of any one of you is put together in his mother’s womb for forty days, then he becomes a `alaqah (a piece of thick coagulated blood) for a similar period, then he becomes like a chewed piece of flesh for a similar period, then Allah sends an angel who is enjoined to write down four things, and it is said to him: ‘Write down his deeds, his provision, his lifespan and whether he is doomed for Hell or destined for Paradise. Then the soul is breathed into him.” (Al-Bukhari)

On this, Sheikh Ahmad Kutty, an Islamic scholar states:

If your bleeding was not due to menses but it was due to miscarriage at such an early stage, then you should  perform salah; you simply need to wash yourself and perform wudu’ and pray. It should only be treated as nifas (postnatal bleeding) if it is preceded by birth. Since it was not due to birth, you can assume that it is not nifas.

However, if the fetus has evolved and is fully formed then it should be treated as bleeding due to nifas.