ONE MUST HAVE A SON AND A DAUGHTER [Peru u'Rvu]
61b (Mishnah - Beis Shamai): A man may not neglect having children unless he has children. He must have (at least) two male sons;
Beis Hillel say, he must have a male and a female - "Male and female He created them."
Beis Shamai learn from Moshe - "Moshe's children were Gershom and Eliezer".
Beis Hillel learn from the creation of the world (Adam and Chavah).
Beis Shamai do not learn about something possible (it is feasible that the Mitzvah of Peru u'Rvu is fulfilled with only males) from something impossible (it was essential to create a male and a female).
62a (Beraisa #1 - R. Noson): Beis Shamai say that one must have two sons and two daughters. Beis Hillel require one of each.
(Beraisa #2 - R. Noson): Beis Shamai require one male and one female. Beis Hillel require a male or a female.
(Rava): According to R. Noson (in Beraisa #2), Beis Hillel learn from "Lo Sohu Vera'ah Lasheves Yetzarah" - one child fulfills Sheves (populates the world).
(Rav Huna): If a man had children and they died, he fulfilled Peru u'Rvu;
(R. Yochanan): He did not.
Rav Huna holds like Rav Asi:
(Rav Asi): "Ki Ru'ach mi'Lefanai Ya'atof (souls in front of Me delay)" - (Moshi'ach) the son of David will not come until all Neshamos in 'Guf' (a treasury) are completed.
R. Yochanan says that he was not Yotzei, for he did not fulfil "Lasheves Yetzarah"; he did not help populate the world.
Question #1 (against Rav Huna - Beraisa): Grandchildren are like children (a living grandchild substitutes in place of his deceased parent).
Answer: No substitute is needed for a deceased child. The Beraisa teaches that grandchildren join with children to fulfill the required number of boys and girls.
Question #2 (Beraisa): Grandchildren are like children. If a child died, or was found to be a Seris, his father did not fulfill Peru u'Revu.
Rav Huna is refuted.
(Beraisa): Grandchildren are like children.
(Abaye): This refers to a son of a son, or a daughter of a daughter, and all the more so a son of a daughter, but not a daughter of a son.
Objection (Rava): We must fulfill "Lasheves Yetzarah". Also a daughter of a son fulfils this!
Both agree that we cannot count two grandchildren from one child.
Question (Rabah): What is the source that grandchildren are like children? (Rashi - he asks about sons of daughters. It is clear that sons of sons are like sons.)
Answer: We learn from "Chetzron fathered Seguv from Machir's daughter", "Rulers came from Machir" and "Yehudah is my ruler". (Even though the paternal lineage of all rulers is from Yehudah, some are attributed to Machir, because his daughter's son is like his son.)
Rif and Rosh (6:7): A man may not neglect having children unless he has children. Beis Shamai say, he must have two male sons. Beis Hillel say, he must have a male and a female.
Rif and Rosh (6:8): Rav Huna was refuted (so the Halachah follows R. Yochanan, who says that if one had children and they died, he was not Yotzei Peru u'Rvu. Abaye thought that if the child left a child it is as if the child is still alive, except for a son who left a daughter. Rava taught that even this suffices, for also a daughter of a son fulfils "Lasheves Yetzarah." All agree that we cannot count two grandchildren from one child. The Halachah follows this.
Rambam (Hilchos Ishus 15:4): A man must have a son and a daughter to fulfill Peru u'Rvu, for it says "Zachar u'Nekevah Bera'am".
Magid Mishneh: One is not Yotzei with two children of the same gender.
Rambam (5): If Levi had children and they died but they left children, he was Yotzei Peru u'Rvu. Grandchildren are like children. This is if the grandchildren included a male and a female, and one of them is the child of Levi's son and the other is the child of Levi's daughter.
Tosfos (62b DH v'Chol): Two sons are not like a son and daughter. However, when a son and daughter died and each left a son, since the grandsons are in place of children who exempted from Peru u'Rvu, surely a grandson stands in place of his mother.
Shulchan Aruch (EH 1:5): Once a man has a son and a daughter he fulfilled Peru u'Rvu, for it says "Zachar u'Nekevah Bera'am".
Shulchan Aruch (6): If Levi had children and they died leaving children, he was Yotzei. This is if the grandchildren included a male and a female, and they come from a son and daughter of Levi, even if the granddaughter is from Levi's son. If both grandchildren were from one of Levi's children, he was not Yotzei.
Beis Yosef (DH Hayu): The Tur says 'if the son left a son or daughter, or the daughter left a son or daughter, he was Yotzei.' It seems that this is even if both of them left sons, or both left daughters. However, the Rambam requires a grandchild of each gender.
Darchei Moshe: The words of the Tur do not force us to say that he disagrees with the Rambam. Even if he allows grandchildren of the same gender, this is because they came from children (of different genders,) who exempted Levi. If Levi had two sons, and they had a child of each gender Levi was not Yotzei. If not, one is always Yotzei with two sons, for surely they will have a female descendant in some future generation!
Note: It is not clear why this is necessary. The sons could die without children! Also, perhaps the leniencies for one who fulfilled Peru u'Rvu (e.g. he need not marry a fertile woman) apply only after a male and female descendant have been born!
Chelkas Mechokek (7): Tosfos says that one is Yotzei with two male descendants who come from a son and a daughter. Shiltei ha'Giborim (19b:3) says that the conclusion is that even two females from a son and a daughter suffice. It is not clear what the Rambam would say if Levi's son or daughter died and left a daughter or son, respectively.
Taz (7): The Terumas ha'Deshen says that Tosfos explains Abaye, but he agrees that the Halachah requires a surviving descendant of each gender, like at the creation. There is no argument among the Poskim.
Gra (14): The simple reading of the Sugya is that even two grandsons from a son and daughter suffice, and according to Rava even two granddaughters. However, one could explain that Rava said 'all the more so a grandson stands in place of his mother' provided that Levi's son is alive, and a granddaughter stands in place of her father provided that Levi's daughter is alive. However, it is difficult to say that a son is better than his son. It seems that Rava said only 'We must fulfill "Lasheves Yetzarah"', but not 'and this is fulfilled'. Actually, it seems that in the Rambam's text Abaye says that a granddaughter does not stand in place of her father, and a grandson cannot be in place of his mother. Rava replied that even this fulfills "Lasheves Yetzarah".