Yes it can be confusing. Notice these groups are described as Main Groups, and also that the block in between (often called the d-block) is described as being for the Transition Metals. The "transition" metals were historically viewed as being in the transition from the simpler rules of chemical behaviour of the light elements of the 1st 3 rows to the more complex behaviour of the heavier ones from the 4th row onward. (As with so many things in science, history has a lot to do with how things end up being named.)
Nowadays, it is really better to speak of the s-block, for the 1st 2 main groups, the p-block for groups 3-7 and 0, the d-block for the transition metals (and the f-block for the so-called lanthanides and actinides that are usually represented below the d-block.) But over the years there have been many different ways to display the table and also a variety of different numbering systems and naming conventions. So inevitably you will come across a few different ones in your reading. Just keep the shape in your mind: 2 columns of s-block metals on the left, 6 columns of p-block elements on the right, with the metal/non-metal diagonal running obliquely through them like a staircase, and the d- and f- block metals in the middle.
The reason for the rather ungainly shape of the table is to do with the order in which electrons build up* in layers within the atom, as one moves through the table from lighter elements to heavier ones. Remember that It is the outer electrons (called the "valence" electrons) that are responsible for the chemical behaviour of the elements. The shape of the outermost layer, and how strongly or weakly bound the electrons in it are, is what determines how the element will behave in chemical reactions.
* from the German Aufbauprinzip or building up principle, which explains how the behaviour of the outermost electrons is determined by quantum theory. You will get to that in due course. It's rather cool.