Covalent bonds are formed mainly between two non metals as electrostatic or ionic bond is prevented from being formed take the example of methane or CH4 (4 means four atoms of hydrogen) in this covalent bonding one atom of carbon combines with four atoms of hydrogen carbon also forms a large number of compounds or more commonly called hydrocarbons due to its property called catenation here hydrogen wishes to gain one electron to obtain duplet atomic structure of helium its closest noble gas element and carbon requires eight electrons in its outermost shell to attain a stable electronic configuration therefore carbon give one electron to each of the four hydrogen atoms and hence hydrogen attain the duplet electronic configuration having two electrons in its outermost shell and carbon loses four electrons from its outermost shell and four hydrogen atoms gain one electron from carbon forming methane covalent bond