to know the number of valence electrons you must know the number of electrons in the outer shell .. In the periodic table there are 8 groups (which are the vertical columns) .. ignore the yellow ones for now which are the transition metals .. the group number is the number of electrons in the most outer shell of an atom .. so for example lithium and sodium are in group 1 so they have only 1 electron in their outer shell .. the valence electrons are the ones an atom looses or gains during a chemical reaction (atoms try to be stable by having 8 electrons in their outer most shell) .. for example atoms in group 1 have 1 electron in their outer shell that they want to loose so the valency is 1 .. In group 5 they need to become 8 so they gain 3 electrons so the valency is 3