A covalent bond, also called a molecular bond, is a chemical bond that involves the sharing of electron pairs between atoms.
The electron pairs are shared between participating elements, these electron pairs are known as shared pairs or bonding pairs, and the stable balance of attractive and repulsive forces between atoms, when they share electrons, is known as covalent bonding.
In CH4, methane molecule Carbon has 6 electrons with 4 electrons in valence shell ( 1s2, 2s2, 2p2). It requires 4 more electrons to complete octet (to have 8 electrons in the outer shell). Whereas, each Hydrogen atom has only one electron in outer shell (1s1) and need one more for stable configuration. Therefore each of four H atom share their 4 electrons with four electrons of carbon atom forming 4 shared pair of electrons, forming four covalent bonds.