"Co" = Sharing. "Valent" = Valence electrons.
Typically, the purpose of covalent bonds are to
achieve a stable octet (or duplet, for hydrogen).
Reason for the idea (but don't make it a dogma, understand it
intelligently) for "non-metal & non-metal = covalent bonding"
is due to the (relatively) smaller difference in electronegativites
between the species involved.
"Metal & non-metal = ionic bonding" is due to the presence
of cations (usually the metal) and anions (usually the non-metal).
Take note, that there are non-metal cations too (see Postscript
below).
Metals are electropositive (ie. strong tendency to lose
electrons, hence forming cations) while for non-metals,
electronegativity (ie. tendency to gain electrons, h increases
from left to right, and from bottom to top, of periodic table, with
the most electronegative element being F.
The intramolecular Br-Br bond is obviously purely covalent
because bromine has the same electronegativity as bromine. The
intermolecular forces between Br2 molecules, are induced dipole -
induced dipole van der Waals forces.
Mg2+ cation, SO4 2- anion. Electrostatic forces of attraction =
ionic bonding.
Ca2+ cation, Cl- anion. Electrostatic forces of attraction =
ionic bonding.
NH3 - trigonal pyramidal with net dipole moment as N is more
electronegative than H. Hence hydrogen bonding and/or
permanent dipole - dipole interaction exists between
NH3 molecules. But intramolecular bonds between N and H are
(polar) covalent.
CHCl3 - trichloromethane. Polar covalent bonds
intramolecular present in this tetrahedral molecule, particularly
between the highly electronegative chlorine and the less
electronegative carbon. (carbon is only slightly more
electronegative than hydrogen). Net dipole moment exists in CHCl3,
a polar molecule. Hence permanent dipole - dipole
interaction (but not hydrogen bonding) exists between
CHCl3 molecules.
SO2 - sulphur dioxide. Polar covalent bonds intramolecular bonds
present in this bent / non-linear / v-shape molecule. Oxygen is
more electronegative than sulphur. Molecular is polar overall, with
permanent dipole - dipole intermolecular interactions.
PS.
Regarding the simplified (and false) 'dogma' that "non-metal
& non-metal = covalent, metal & non-metal = ionic", you may
observe the limitations of said 'dogma' in considering the
following.
1) There can be non-metal cations too, eg. NH4+
(when the Bronsted Lowry base NH3 abstracts a proton to become
the conjugate acid NH4+, ie. a lone pair on NH3 becomes a bond pair
between N and the incoming H, causing a positive formal
charge to result on the central N species). Hence, there exist
electrostatic forces of attraction, ie. ionic bonding, between
non-metal oppositely charged ions, eg. ammonium cation and
sulphate anion. Take note that hydrogen, can form both cations and
anions, known as protons (think : when a typical hydrogen atom
(not deuterium or tritium isotope) loses an electron, what is
left? any neutrons?) and hydride ions, respectively.
2) Dative (ie. 'donated') or coordinate covalent
bonds, are also present between metals (usually transition metals)
and non-metal electron donors known as ligands, to form
complex ions. The ligands behave as nucleophiles towards the
electrophilic central metal species. Eg. Four monodentate NH3
ligands donate their lone pairs to form dative/coordinate covalent
bonds with a central Cu2+ ion, forming the
tetraaminecopper(II) ion, [(NH3)4 Cu]2+ complex ion.