What do valence electrons have to do with bonding?
Valence electrons are the number of electrons that are present to an atom at it's outer shell. It can be determine through the groups where each element is situated in.
Also, the type on bonding depends on whether both atoms are nonmetals, metals or from different sides.
Nonmetal atoms usually form covalent bonds while metal and nonmetal atoms will form ionic bonds.