Each team in each group has to compete with the other five teams, which means 6*5=30 games, but each game counts twice. For example, the match between Team A and Team B is counted once when Team A counts and once when Team B counts, so each team has played 15 games, so 8.
I hope I can help you!