Formation of Chlorine gas

Cl atom has 7 valency and needs one electron, each, to form a noble gas configuration between two Cl atoms. Hence they share an electron each to hence share 2 electrons between the atoms. Hence, each Cl atom now has 8 valency which is a noble gas configuration.