1,019. The Obligation to Marry and Have Children
145:1 A man is obligated to get married in order to fulfill the mitzvah to have children. A man becomes obligated in this mitzvah at the age of 18. He should not pass his 20th year without a wife unless he occupies himself diligently with Torah study and is concerned that if he marries, it will affect his learning. In such a case, it is permitted for him to delay marrying, so long as he is not overcome by his physical urges.
145:2 Having both a son and a daughter fulfills the mitzvah to procreate provided that the children are not infertile. If a person had a son and a daughter who died, if they left children of their own, he has fulfilled his obligation to procreate. This is the case when his grandchildren are a boy and a girl and they each have children, even if his son had a daughter and his daughter had a son. Since they came from his children, he has fulfilled his obligation to procreate. However, if one of his children left no offspring, he has not fulfilled the mitzvah even if his other child left several sons and daughters.