Each team needs two girls, so we have a choice of 18. After picking one girl there are 17 left, so we pick one. It doesn't matter which order so, since there are 2 different ways of arranging 2 girls, the number of ways of combining 2 girls (18C2) is 18*17/2=153. There are 23 children left to choose from and we need 3 of these. There are 6 ways of arranging 3 different children in order, so simply combining them is given by 23*22*21/6=1771 (23C3). Combining the two results we get 153*1771=270,963.
Best to try and use simple logic. That's what mathematics is really all about. Formulas and prescriptions may speed things up but they don't necessarily help you understand what's going on.