This image is an animation that details the steps leading to the formation of a covalent bond. There is not a complete electron transfer as with an ionic bond, but the two atoms share two electrons. This is achieved by sharing two electrons with the 2 hydrogen atoms. In these compounds, carbon requires 4 electrons to fill its outer shell. On earth, carbon compounds are the most common.
Life is based on such compounds.
These are studied in Organic Chemistry and Biochemistry. As opposed to ionic bonds, which are due to coulombic forces between opposite charges-not directional, covalent bonds are localized between two atoms, and have a definite shape. The covalent bonds exist between the yellow balls. The theory to explain bonding in metals is called The Band Theory. It is based on quantum mechanics.