Yevamot, Chapter Ten, Mishnah Five
This mishnah deals with a quite complicated situation in which a man marries a series of sisters, thinking that each previous one was dead, and then finds out that they are all alive. If we sort out all of the details, this braintwister shouldnt be so bad.
1) If a man was told Your wife is dead and he married her paternal sister; [and when he was told] She is dead, he married her maternal sister; [and when he was told] She is dead, and he married her paternal sister; [and when he was told] She is dead, he married her maternal sister; and later it was found that they were all alive, he is permitted to the first, third and fifth, and they exempt their rivals;
a) But he is forbidden to the second and the fourth, and intercourse with one of these does not exempt her rival.
2) If he had intercourse with the second after the death of the first, he is permitted to the second and fourth, and they exempt their rivals;
a) But he is forbidden to the third and the fifth, and intercourse with one of these does not exempt her rival.
Section one: A man was married to Rachel (1), and when told that she died, he married Hana (2), Rachels paternal sister. When told that Hana died, he married Tova (3), Hanas maternal sister. Rachel (1) and Tova (3) do not share any parents. When told that Tova has died, he marries Yael (4), Tovas paternal sister. Yael (4) does not share any parents with Rachel (1) or Hana (2). When told that Yael has died, he marries Rivka (5), Yaels maternal sister. Rivka (5) does not share any parents with Rachel (1), Hana (2) or Tova (3).
At this point, the hapless husband finds out that all of these women are still alive (you can just imagine the shock on the poor guys face!). The mishnah rules that he may stay married to the first, the third and the fifth. This means that even though the third woman is the second womans sister, and he is forbidden to the second woman, he may stay with the third (the same with the fifth, who is the fourths sister). This is because the marriage to the second and the fourth was not valid marriage, because he had already married the first and the third, and they were still alive. Since the marriage with the second and the fourth was not valid marriage, he is permitted to marry their sisters.
The mishnah also teaches that the first, third and fifth women exempt their rival wives from the need for yibbum. This means that should this husband die without children, when one of his brothers does yibbum or halitzah with one of these women, the rest of the women are exempt.
He is forbidden to stay married to the second and the fourth women, since they are the sisters of the first and third respectively. Since both of these women are not validly married, and therefore are not liable for yibbum or halitzah, should someone perform yibbum or halitzah with them, it would not exempt their rivals.
Section two: After the death of the first wife, he is permitted to have relations with the second wife. If he does so, then he can no longer stay with the third wife, and he can now have relations with the fourth wife (since the marriage with the third wife is now invalid). Since he can have relations with the fourth wife, he cannot stay married to the fifth wife. In this case, the second and fourth wife would be liable for yibbum and therefore they make their rival wives exempt. The third and fifth wife are not liable for yibbum, therefore they would not make their rival wives exempt.