The number of shells is equal to its period number and the number of valence electrons tells us about its group. Let us take Oxygen for example. Its electronic configuration is 2, 6. It has two shells and 6 valence electrons. It is thus placed in the second period and 6th group.