Niddah 3:6-7
Niddah 3:6
If a woman miscarries and the gender of the fetus is unknown, she observes the procedures for both a boy and a girl. If it’s unknown whether or not it was a fetus, she observes the procedures for both a boy and a girl, plus she’s a niddah.
Niddah 3:7
If a woman miscarries on the fortieth day after conception, she need not be concerned that it was yet a fetus; on the forty-first day, she observes the procedures for both a boy and a girl, plus she’s a niddah. Rabbi Yishmael says that on the forty-first day she observes the procedure for a boy, plus she’s a niddah; on the eighty-first day, she observes the procedures for both a boy and a girl, plus she’s a niddah. This is because a male fetus is completed on the forty-first day and a female fetus on the eighty-first. The Sages, however, say that both a male and a female fetus are formed on the forty-first day.