The bond joining two hydrogen atoms in a hydrogen gas molecule is a classic covalent bond. The bond is easy to analyze because the hydrogen atoms only have one proton and one electron each. The electrons are in the hydrogen atom's single electron shell, which has room for two electrons.
Because the hydrogen atoms are identical, neither can take the electron from the other to complete its electron shell and form an ionic bond. As a result, the two hydrogen atoms share the two electrons in a covalent bond. The electrons spend most of their time between the positively charged hydrogen nuclei, attracting them both to the negative charge of the two electrons.
TL;DR (Too Long; Didn't Read)
Molecules of hydrogen gas are made up of two hydrogen atoms in a covalent bond. Hydrogen atoms also form covalent bonds in other compounds, such as in water with an oxygen atom and in hydrocarbons with carbon atoms. In the case of water, the covalently bonded hydrogen atoms can form additional intermolecular hydrogen bonds that are weaker than the covalent molecular bonds. These bonds give water some of its physical characteristics.
Covalent Bonds in Water
The hydrogen atoms in the H2O water molecule form the same kind of covalent bond as in hydrogen gas but with the oxygen atom. The oxygen atom has six electrons in its outermost electron shell, which has room for eight electrons. To fill its shell, the oxygen atom shares the two electrons of the two hydrogen atoms in a covalent bond.
In addition to the covalent bond, the water molecule forms additional intermolecular bonds with other water molecules. The water molecule is a polar dipole, which means that one end of the molecule, the oxygen end, is charged negatively, and the other end with the two hydrogen atoms has a positive charge. The negatively charged oxygen atom of one molecule attracts one of the positively charged hydrogen atoms of another molecule, forming a dipole-dipole hydrogen bond. This bond is weaker than the covalent molecular bond, but it holds the water molecules together. These intermolecular forces give water specific characteristics such as high surface tension and a relatively high boiling point for the weight of the molecule.
Carbon and Hydrogen Covalent Bonds
Carbon has four electrons in its outermost electron shell, which has room for eight electrons. As a result, in one configuration, carbon shares four electrons with four hydrogen atoms to fill its shell in a covalent bond. The resulting compound is CH4, methane.
While methane with its four covalent bonds is a stable compound, carbon can enter into other bond configurations with hydrogen and other carbon atoms. The four outer electron configuration allows carbon to create molecules that form the basis of many complex compounds. All such bonds are covalent bonds, but they allow carbon great flexibility in its bonding behavior.
Covalent Bonds in Carbon Chains
When carbon atoms form covalent bonds with fewer than four hydrogen atoms, extra bonding electrons are left in the carbon atom's outer shell. For example, two carbon atoms that form covalent bonds with three hydrogen atoms can each form a covalent bond with each other, sharing their single remaining bonding electrons. That compound is ethane, C2H6.
Similarly, two carbon atoms can bond with two hydrogen atoms each and form a double covalent bond with each other, sharing their four leftover electrons between them. That compound is ethylene, C2H4. In acetylene, C2H2, the two carbon atoms form a triple covalent bond and a single bond with each of the two hydrogen atoms. In these cases, only two carbon atoms are involved, but the two carbon atoms can easily maintain only single bonds with each other and use the rest to bond with additional carbon atoms.
Propane, C3H8, has a chain of three carbon atoms with single covalent bonds between them. The two end carbon atoms have a single bond with the middle carbon atom and three covalent bonds with three hydrogen atoms each. The middle carbon atom has bonds with the other two carbon atoms and two hydrogen atoms. Such a chain can be much longer and is the basis for many of the complex organic carbon compounds found in nature, all based on the same kind of covalent bond that joins two hydrogen atoms.