It is useful to think of an atom as having electrons circling in layers around its nucleus. These layers are known as “shells”. Each layer can only have a certain number of electrons before a new shell must be started. Atoms that have as many electrons as possible in the outer shell (or some other particular numbers) are said to be stable. They do not easily form bonds with other atoms. Atoms that are not stable try to become so by sharing electrons with, or borrowing electrons from, or giving electrons to, another atom. The number of electrons that an atom needs to give or gain to achieve a stable outer shell is called its valency.

The combining capacity of an atom is called its valency. Actually it can be defined as the number of electrons that an atom may lose (or) gain during a chemical reaction (or) the number of electrons shared. The numbers of electrons in outermost shell (or) valency shell of an atom are called valency electrons. 

The valency of an element is the number of atoms lost or gained by the atom of an element. Valence electrons are the number of electrons present in the outermost shell of an atom valency of an element depends on the valence electrons valency of atoms having 1, 2, 3 valence electrons = number of valence electrons valency of atoms having 5, 6, 7 valence electrons

= 8 – number of valence electrons

Picture Credit : Google