The classification is based on, the orbital occupied by the last electron,
if the last electron enters S orbital, the element goes in the S block.
If it enters in the P block, the element goes in P block and so on.
About the Orbitals, you will study more in detail in the higher classes if at all you take science.