Yevamos 2:5-6
Yevamos 2:5
Any kind of brother (e.g., even a mamzer – i.e., the product of an incestuous or adulterous relationship) creates a yibum connection to his wife upon his death and is his brother in all regards (e.g., in inheritance matters) except for a brother from a Canaanite maidservant or a non-Jewish woman. If the deceased has any kind of son (again, for example, a mamzer), then a yibum connection is not formed, the son is legally liable for striking or cursing the father, and he is his son in all regards (again, such as inheritance) except for a son from a Canaanite maidservant or a non-Jewish woman.
Yevamos 2:6
If someone married one of two sisters but he doesn’t know which one, he must give a divorce to each of them. If he dies and leaves one brother, he must perform chalitzah with each of them. If there are two brothers, one must perform chalitzah, after which the second has the option to perform yibum. If both brothers married both sisters, they may remain married even though this was not the appropriate course of action.