How can we find the group number of an element?
Mg. Its atomic no. is 12. The electronic configuration is ( 2,8,2). It has 3 numbers thats why it belongs to 3rd period and the last electronic configuration that is of the outer shell has 2 so it belongs to second group.