Yevamot, Chapter Eleven, Mishnah Four
This mishnah deals with the complex situation where a mothers son gets mixed up with her daughter-in-laws son. Afterwards each woman has another son, such that it is unclear who is whose brother and who is whose fathers brother. I will try to use names to make the situation clearer. Sarah is the mother and Rebekah is the daughter-in-law. They give birth each to one son, Joe and Stanley, but they dont know whose child is whose. They each also give birth to another son, Sarah to Moshe and Rebekah to Eli. Joe and Stanley might be Elis brother or his uncle. Joe and Stanley might be Moshes brother or his nephew. Our mishnah deals with cases of potential yibbum involving these four men.
1) If the child of a woman was mixed up with the child of her daughter-in-law and the mixed-up children grew up and married women and then died, the [other] sons of the daughter-in-law perform halitzah but may not contract yibbum, for it is uncertain whether she is the wife of his brother or the wife of his fathers brother.
a) The [other] sons of the older woman either perform halitzah or yibbum, since the only doubt is whether she is the wife of his brother or the wife of his brothers son.
2) If the not-mixed-up sons diedthen [with respect to the widows of the sons of the older woman] the mixed-up sons perform halitzah and may not have yibbum, since it is uncertain whether she is the wife of his brother or the wife of his fathers brother;
a) [With respect to the widows] of the sons of the daughter-in-law one performs halitzah and the other [may] have yibbum.
Section one: If Joe and Stanley each married a woman and then died without children, their wives become liable for yibbum or halitzah with either Moshe or Eli. Eli, Rebekahs son, must perform halitzah for each woman for each might be the widow of his brother. He cannot have yibbum with either for either might be his fathers brothers wife and it is forbidden to have relations with ones fathers brothers wife.
After Eli has performed halitzah with both women, Moshe, Sarahs son, may either have halitzah or yibbum with either. He may have yibbum with either for if she is his brothers wife, then the yibbum is valid. If she is his wife of his brothers son, he is still permitted to marry her for it is permitted to marry the wife of ones brothers son. This mishnah is based on the fact that it is permitted to marry ones nephews wife but not ones uncles wife.
Section two: In this case, Moshe and Eli die and each woman becomes liable for halitzah to Joe and Stanley. Both Joe and Stanley must perform halitzah for Moshes wife, lest she be their dead brothers wife. They may not have yibbum with her lest she be the wife of their fathers brother. With Elis wife one must have halitzah, lest she be his brothers widow but then the other may have yibbum. Yibbum in this case is permitted because even if she is not his dead brothers wife she is his brothers sons wife and it is permitted, as we learned above, to have relations with ones brothers sons wife.
In summary, if there is the possibility that the woman is his fathers brothers wife, he may not have yibbum with her. If there is a possibility that she is his brothers sons wife he may have yibbum since this is permitted.