Atoms are most stable when they have a valence (outer most) shell with a full set of electrons. For many atoms this would be 8 electrons, hence called the octet rule. However, very few atoms start off with a full octet. Why then isn't the universe an unstable mess of atoms? The answer is BONDING!
Atoms share electrons with each other and thus are able to count them as part of their valence shell and achieve a full octet.
There are three types of bonds we will study: nonpolar covalent, polar covalent, and ionic. For the most part the type of bond depends on the difference in electronegativity, how strongly an atom's nucleus pulls on the electrons. Nonpolar covalent bonds occur when both atoms have an equal pull on the electrons. Atoms in this bond evenly share the electrons. In a polar covalent bond one atom is slightly stronger than the other, and pulls the electrons closer to itself. Ionic bonds form when one atom is much stronger than the other and completely pulls the electrons of of the other atom.