Elements are arranged in increasing order of atomic number in the periodic table. The elements placed in group 16 have 6 electrons in the outer most shell, elements of group 17 have 7 valence electrons and the group 18 elements have 8 valence electrons.
Electronic configurations of Sulphur (S), Chlorine (Cl) and Argon (Ar) are:
S = 2, 8, 6
Cl = 2, 8, 7
Ar = 2, 8, 8
With 6 valence electrons S is placed in Group 16, Cl with 7 valence electrons is placed in Group 17 and Ar with 8 valence electrons is in Group 18.