We can have the groups assigned with the following number of people:
$$(1)\,\{2,2,2,2,2\}\\(2)\,\{2,2,3,3\}$$
Case 1: Choose groups of $2$ from $10, 8, 6, 4$ in succession until we reach our final pair. Our $5$ sets of groups are the same irrespective of the order in which they are chosen, so the number of ways here would be: $$\binom{10}{2}\binom{8}{2}\binom{6}{2}\binom{4}{2}\frac{1}{5!}$$
Case 2:
- Choose $3$ people from $10$.
- Choose $3$ people from the remaining $7$.
- Choose $2$ people from the remaining $4$, leaving the remainder to form the final pair.
In summary, we have $2$ different types of groups, each containing $2$ groups. Eliminating repeats by accounting for the order in which such groups can be chosen, the number of ways here is: $$\binom{10}{3}\binom{7}{3}\binom{4}{2}\left(\frac{4!}{2!\,2!}\right)^{-1}$$
Add the cases together and you have your result.
$12\choose 6$ double counts. For instance you could choose A, B, C, D, E, F for one group, leaving G, H, I, J, K, L for the other; or you could choose G, H, I, J, K, L for one group, leaving A, B, C, D, E. F. But this actually gives you the same two groupings.
Best Answer
If you specify how many of each size you want it is easy.
For example, splitting $50$ students into groups of sizes $5,5,5,5,6,6,6,6,6$ can be don in $\dfrac{30!}{5!^4 6!^5 4! 3!}$ ways.
In general if you have $n$ students and you split them into $a$ groups of size $x$ and $b$ groups of size $y$ there are $\frac{n!}{x!^ay!^b b!a!}$ ways to do it.
So one way to solve the problem is to calculate the number of ways for each possible way to add up to $n$ using groups of $x$ and $y$. Luckily the non-negative solutions to $ax+by=n$ can be found easily.