When brothers live together and one of them dies without a son, the widow of the deceased shall not marry anyone outside the family; but her husband’s brother shall come to her, marrying her and performing the duty of a brother-in-law.
Then Judah said to his daughter-in-law Tamar, “Remain a widow in your father’s house until my son Shelah grows up”—for he feared that Shelah also might die like his brothers. So Tamar went to live in her father’s house.
Onan, however, knew that the offspring would not be his; so whenever he had intercourse with his brother’s wife, he wasted his seed on the ground, to avoid giving offspring to his brother.