Call the first group A and the second group B.
We can start by assuming that no group can be empty or else the second group would not technically be a group. Thus the combinations
$A = 6$ $ B = 0$
$A = 0$ $B = 6$
cannot exist.
Forming 2 groups can be done by putting a certain number of people in the first group, and then automatically, we have formed the second group. That means that you only ever have to worry about calculating the number of ways to do so for 1 group and that will take care of the second group.
Now to form the first group you can:
- Take 1 person out of 6 and place him in A. B then has 5 people. There are $\binom{6}{1}$ ways of doing this.
- Take 2 people out of 6 and place them in A. B then has 4 people. There are $\binom{6}{2}$ ways of doing this.
- Take 3 people out of 6 and place them in A. B then has 3 people. There are $\binom{6}{3}$ ways of doing this.
- Take 4 people out of 6 and place them in A. B then has 2 people. There are $\binom{6}{4}$ ways of doing this.
- Take 5 people out of 6 and place them in A. B then has 1 person. There are $\binom{6}{5}$ ways of doing this.
We're almost done. Notice 2 things however.
First of all, the grouping of the second group is implicit in the calculation. In fact, taking the first example, if you place 1 person in A there are $\binom{6}{1}$ of doing this, and then $\binom{5}{5}$ ways of putting the remaining 5 people into B. Since $\binom{5}{5} = 1$, each binomial coefficient you see is actually a product of 2 binomial coefficients where one is equal to 1.
Second of all, and most importantly, the order of the teams themselves does not matter. If we choose, say, the pair:
$\{A = 5,B = 1\}$
that's exactly the same pair as this:
$\{A = 1,B=5\}$
Because the order of the teams themselves does not matter, we must divide by 2! = 2, the number of different orders we can put the 2 teams in, because some of the different orders are in fact the same set of teams. When you just multiply your binomial coefficients together (the explicit and implicit one), however, these all get counted as distinct. Dividing by $2!$ collapses these all into a single arrangement.
That means that by the sum rule, there are:
$$
\frac{\binom{6}{1} + \binom{6}{2}+ \binom{6}{3}+ \binom{6}{4} + \binom{6}{5}}{2} = \frac{62}{2} = 31
$$
ways of splitting 6 people into 2 groups.