Atoms bond to each other, usually, for one reason; that is, to complete their electron shell. There are two ways of doing this.
a. Metals (atoms on the left of the periodic table) join non-metals (atoms on the right of the periodic table). Here the metal losing one or more electrons and it is actually transferred to the non-metal. The metal atom now has a + charge and the non-metal has a - charge. The is called an ionic bond which actually is the attractive force between the + and - charges. The metal is left with its outside shell filled (having lost the electron(s) in its outer shell) and the non-metal has gained electrons to fill its outside shell. The term electronegativity is used to tell us how easily electrons lose (or gain) those electrons.
b. However, when two atoms that are alike try to combine, their electronegativity rating is exactly the same and neither electron has the ability to pull electrons from the other. These atoms must find another way to bond since they can't exchange electrons; therefore, they share their electrons. Basically, when two Cl atoms combine, they share their 14 electrons (7 electrons from each Cl atom) in such as way as to make each Cl atom think it has eight in its outside shell.
We can't draw these structures on the board
Cl:Cl with : top, bottom, and side of ech Cl atom.
Or the H atom is another example. Each H atom has 1 electron and it needs two so they share the two like this H:H. Thus each H atom thinks it has two electrons--we've made 1 electron do the job of two. Basically, then, atoms that are alike share electrons.