There is a commandment of "Peru urevu," which can be fulfilled (or the person made exempt) by having "two children." Does that mean that one must have a male and female child, or is it any 2+ number of children (meaning, two males/two females)?
Once a man has a male and female child who themselves are able to procreate, he had fulfilled his obligation. See Shulchan Aruch, Even Ha'ezer 1:5.
Fulfilling ones obligation with two boys was the opinion of Beis Shamai which we do not rule with. The Yerushalmi in Yevamos mentions an opinion that Beis Hillel also ruled that bidieved one has fulfilled his obligation with two boys. This too is not brought as halacha.
The only time I know of where one has fulfilled their obligation with two progeny of the same gender would be when someone had both a son and daughter, one or both of whom passed away in his lifetime. If these children had left one child each of their own, then the father of the deceased children had still fulfilled his obligation being that there are two children that that came from his two children. Almost unanimously, the Rabbis say these grandchildren must be one male and one female for him to have fulfilled his obligation. There is a minority opinion that two grandchildren of the same gender would indeed be good enough. See the Shulchan Aruch there siff 6 with Chelkas Mechokek, Beis Shmuel, & Pischei Tshuva. The Aruch Hashulchan in that siman siff 16 also brings all the opinions and doesn't seem to give a definitive ruling on this situation.
Rambam says in הלכות אישות פרק טו,א that it is a positive Torah commandment for men and then continues in ד and ה:
ד כמה בנים יהיו לאיש, ותתקיים מצוה זו בידו--זכר ונקבה, שנאמר "זכר ונקבה, בראם" (בראשית ה,ב); היה הבן סריס, או שהייתה הבת איילונית--לא קיים מצוה. [ה] נולדו לו ומתו, והניחו בנים--הרי זה קיים מצות פרייה ורבייה: בני בנים, הרי הם כבנים.
How many children should a man have, such that this mitzvah is fulfilled -- a male and a female, as it is said in the Torah "male and female, he created them"; the son was a unic, or the daughter was infertile -- he has not fulfilled the commandment. If they were born to him and died, and left children of their own -- see he has fulfilled the commandment of be fruitful and multiply: the children of children are like one's own children.
ה במה דברים אמורים, בשהיו בני הבנים זכר ונקבה, והיו באים מזכר ונקבה, אף על פי שהזכר בן בתו, והנקבה בת בנו--הואיל והם משני בניו, הרי קיים מצות פרייה ורבייה; אבל אם היה לו בן או בת ומתו, והניח אחד מהן זכר ונקבה--עדיין לא קיים מצוה.
What does this mean, that the grandchildren where a male and female, and they came from a male and female, even if the male is the son of his daughter, and the female the daughter of his son -- since they are from both his children, see he has fulfilled the commandment of be fruitful and multiply; but he had a son or daughter and they died, and one of them had a son and daughter -- he still did not fulfill the commandment.
Further on in הלכות אישות פרק טו, טז he says:
אף על פי שקיים אדם מצות פרייה ורבייה, הרי הוא מצווה מדברי סופרים שלא ייבטל מלפרות ולרבות, כל זמן שיש בו כוח--שכל המוסיף נפש אחת מישראל, כאילו בנה עולם
Even though a man has fulfilled the Torah commandment of be fruitful and multiply, see he is commanded from the words of our Sages [ i.e. a Rabbinic commandment ] that he should not cease from to be fruitful and multiply, for as long as he has strength -- since anyone who adds one soul to Israel, it's as if he built a whole world.