Covalent bonding relies on the fact that all atoms are desperately trying to get a full outer shell of electrons. By full outer shell we mean 2 electrons in the first shell, 8 in the 2nd shell, 8 in the 3rd and 18 in the 4th.
If you were to draw out the electronic configuratio for the atoms of many elements like carbon, hydrogen, oxygen or chlorine, you'll find that they are missing some electrons from their outer most shells, i.e. they are not yet 'full'.
We will use the e.g. of Hydrogen (H) and Chlorine (Cl). H has 1 electron in its outer shell and would ideally like to have 2 whilst Cl on the other hand has 7 and would ideally like to have 8. In order to overcome this, the 2 atoms bond by sharing one electron with each other. Cl shares one of its electrons with H to give H 2 electrons and H shares its one electron with Cl to give Cl 8 electrons- this way they are both bonded with a full outer shell of electrons to form hydrogen chloride. In summary, covalent bonding is the sharing of electrons between atoms.