Electron sharing is the sharing of the outermost electrons between two or more atoms without the complete transfer of electrons to form ions. When atoms share electrons, a covalent bond is formed.
Atoms are most stable when their outermost electron shell is complete. In order to complete the outermost shell, some atoms lose electrons to form positive ions while others gain electrons to form negative ions. However, some atoms share electrons with neighboring atoms to stabilize their outermost electron shell without forming ions. In such cases, neither of the atoms is ionized since the shared pair of electrons are not pulled a sufficient distance away from the nucleus of the atom to be considered "removed" from the atom. This imposes a distance constraint between the two atoms sharing their electrons, which tend to be closer to each other than if they were not sharing the electrons.
An example of electron sharing can be seen in hydrogen gas. Hydrogen has only one electron in its valence shell and needs one more to attain the stable noble gas configuration that helium has. When two atoms of hydrogen share their electrons, they complete each other's valence shell. Similarly, in methane, carbon has only four electrons in its valence shell and needs four more to complete its stable noble gas configuration. It does so by sharing electrons with four hydrogen atoms, thus stabilizing the carbon atom and the hydrogen atoms.