The number of shells present in an atom determines its period and the number of valence electrons determines the group.
Since the element has 2 electrons in its fourth shell which defines that it has 4 shells and 2 valence electrons.
Therefore, the element is placed in period 4 and group 2.