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 thought, “He might die too, like his brothers.” So Tamar went to live in her father’s house.
But Onan knew that the offspring would not be his, so whenever he slept with his brother’s wife, he released his semen on the ground so that he would not produce offspring for his brother.
“When brothers live on the same property and one of them dies without a son, the wife of the dead man may not marry a stranger outside the family. Her brother-in-law is to take her as his wife, have sexual relations with her, and perform the duty of a brother-in-law for her.
Return home, my daughters. Go on, for I am too old to have another husband. Even if I thought there was still hope for me to have a husband tonight and to bear sons,