Yevamot, Chapter Ten, Mishnah Four
This mishnah and the next discuss the ramifications of situations where a husband was told that his wife had died, and he married her sister.
1) If a mans wife had gone to a country beyond the sea and he was told, Your wife is dead, and he married her sister, and afterwards his wife came back, [the latter] is permitted to return to him.
a) He is permitted to marry the relatives of the second woman, and the second woman is permitted to marry his relatives.
b) If the first wife died he is permitted to marry the second.
2) If he was told that his wife was dead, and he married her sister, and then he was told that she was then alive but had since died, any child born before [his first wifes death] is a mamzer, but anyone born after [her death] is not a mamzer.
3) Rabbi Yose says: whoever disqualifies for others disqualifies for himself and whoever does not disqualify for others does not disqualify for himself.
Section one: The mans marriage to his wifes sister was obviously forbidden, since one cannot marry ones wifes sister. However, his original wife is permitted to return to him, since the second marriage was totally invalid. By his first wife returning to him, this would not count as marrying his wifes (his second wifes) sister. Furthermore, since the marriage was invalid, he may marry the second wifes relatives (for instance her daughter). This is true even if he has had sexual relations with her. She too is permitted to marry his relatives.
If his first wife dies, he can now remarry the second wife. Even though he already had relations with her when she was forbidden to him, since she is now permitted to him, he may marry her.
Section two: This section teaches that any child he had with his wifes sister while his wife was still alive is a mamzer, since this is a prohibited relationship, and punishable by kareth. However, children born after his original wife died are not mamzerim.
Section three: The Talmud explains that Rabbi Yose refers to a situation where Reuven was married to Leah and Moshe was married to Rachel, Leahs sister. Leah and Moshe (Reuvens wife and his brother-in-law) go abroad and Reuven receives a report that both of them have died. Reuven now marries Rachel, who he thinks is Moshes widow and his dead wifes sister. When both Leah and Moshe come back, since Rachel is forbidden to return to Moshe (see mishnah one), Leah is forbidden to return to Reuven. The previous tanna would have held that while Rachel was forbidden to return to Moshe, Leah was permitted to return to Reuven.
However, if there was a case where the woman whom he married was not forbidden to return to a previous husband, for instance she was not married or she married him (Reuven) without the permission of the court, since he does not make her forbidden to someone else, his own wife is not forbidden to return to him.