Atoms are able to bond to each other to make molecules and compounds. A compound is a molecule with more than one kind of element in it. How do they do it? It has to do with their electrons.
Ionic Bonds 
When an atom is by itself before it has reacted with anything, it has the same number of protons as it has electrons. With an equal number of protons and electrons, the charges cancel each other out and the atom has no charge.
Sometimes, atoms do not have an equal number of protons and electrons. If an atom loses an electron, that means it has more protons than electrons, and so the atom has a positive charge. If an atom gains an electron, that means it has more electrons than protons, and so the atom has a negative charge. Atoms with a charge are called ions.
To form an ionic bond, some atoms will take an electron from another atom; this will make both of them ions, one positive and one negative. Because one is positive and one is negative, the ions will attract to each other and form an ionic bond. An ionic bond is a bond formed when one atom takes the electron or electrons of another atom.
Covalent Bonds 
Not all bonds are formed by taking electrons away. Atoms can share electrons instead. By sharing electrons, atoms can bond together, but they do not form ions because none of the atoms lost or gained electrons.
Pure Covalent Bonding 
This is when the two atoms that form the bond share the electrons equally.
All atoms can attract electrons in a pure covalent bond. Some have high attracting powers, like oxygen, nitrogen, chlorine, and fluorine. Some have low attracting powers like metals, carbon, and hydrogen. Elements with identical or similar attraction are considered to form pure covalent bonds.
Polar Covalent Bonding 
This involves unequal sharing. The further right and up the Periodic Table, the greater the attracting powers of the element. The exceptions to this are the noble gases. If two elements have significant differences in attracting powers, the result is a Polar Covalent Bond.