The sister-in-law shall not do chalitsah or levirate marriage until it will have been ninety days from the death of [her] husband, exclusive of [both] the day of death and the day of chalitsah or levirate marriage. If [her brother-in-law] did effect levirate marriage or chalitsah during this period, and she does not turn out to be pregnant, she is thereby exempted and needs nothing [further]; however, she shall not marry another, even though she did chalitsah, until ninety days from [her] husband's death are complete. If the brother-in-law dies within the ninety days or after them, some say she must wait ninety days after her death. If there were two brothers-in-law and one of them died, she is permitted to effect levirate marriage with the second within ninety days of the [other] one's death. Comment: And some say that any [case in which] she did chalitsah within three months -- whether she turns out to be pregnant and miscarries or does not turn out to be pregnant -- it is an invalid chalitsah and she requires another chalitsah from all [her husband's] brothers (Hagahot Mordekhai, end of Gittin). See also later, chapter 170 paragraph 5.
[Suppose] someone does chalitsah to his sister-in-law and she turns out to be pregnant and gives birth. If the [new]born is viable, [then] the chalitsah is nothing: [the brother-in-law] is permitted to [his sister-in-law's] relatives and did not invalidate her from the priesthood. If she miscarried or gave birth but [the baby] did not live thirty days, [then] she requires another chalitsah, for chalitsah of a pregnant woman is not named "chalitsah": he or one of the other brothers does chalitsah to her. And some say that he should not do chalitsah to her; rather, one of the other brothers [should] (Tur, in the name of Rosh).
Intercourse with someone pregnant is also not named "intercourse". Therefore, someone who married or did chalitsah to his sister-in-law within three months, and she has a co-[widow], [the latter] should not marry until the [other] gives birth, lest she miscarry and the intercourse or chalitsah will not have been anything, [for] a [new]born does not exempt until he exits into the world's atmosphere.
The sister-in-law shall not effect levirate marriage during the time of her niddah [impurity], but [can] do chalitsah. If [the brother-in-law] transgressed [this] and effected levirate marriage and had intercourse with her during the time of her niddah [impurity], he acquired her.
One who enters his yibbum and it turns out she is pregnant, they separate them and wait on her. If she has a miscarriage, the [yibbum] goes back and is upheld. Rem"a: Some say this is specifically when he enters before he perceived the pregnancy, but if he entered her having already perceived the pregnancy he must be made to leave her even if she miscarriages (N"Y Perek Hacholetz). And in the case the yibbum is upheld [as the Shulchan Aruch discusses], he needs to have the sexual intercourse again, for sex with a pregnant woman is not considered sex (B"Y in the name of Rabbeinu Yerucham). If if wants to leave her [before that second sexual act] she needs [both] a bill of divorce and chalitza.
A fetus that does not have complete signs [indicating life] and he was not [born at] full term, is called a "nefel" [a baby assumed to die]. And if the fetus was born with completed signs but it is not known whether he was [born] full term, even if he died on the day he was born, she goes out with a bill of divorce and does chalitza to her, and afterwards she will be permitted to others. If the fetus survives thirty days after it was born Rem"a: or it was born full term (HM"M) that is a fetus [assumed] to continue [to live], and she does not need a bill of divorce from him, for she is an erva [improper relationship] toward him.
If she gave birth to an viable child six months after she had yibbum, this child is doubtful nine months to the first or seven months to the second. Therefore, she goes out with a get and the child is valid. And if he has relations with her after she gives birth and she gets pregnant and gives birth, that child is a doubtful mamzer.
Any yevama who is Rabbinnicaly doubtfully encumbered to her yavam, such as a yevama who gave birth to a baby and it is unknown if his months are complete (7 months) and he died on or before his 30th day, about whom the Sages said to perform chalitza due to a rabbinic doubt (if she needs yibur), if she went and became betrothed or married to another man without performing chaluzta, her yavam performs chalizta and she may remain with her husband. If she married a Kohen, who is forbidden to a woman who performed chalizta, the yavam does not perform chalizta with her, because we will not forbid her to her husband based on a Rabbinic doubt. Rama: Similarly if the yavam is not present she does not have to leave her non-Kohen husband, and she is permitted to remain with her husband since she already married him (Ri Mintz). If her Kohen husband divorced her or died, she must a priori perform chalitza, and after that she may remarry.