Answer:
Atoms only share electrons in covalent bonds. covalent bonds are only formed between nonmetals. there are two different types of covalent bonds; polar and nonpolar. in a polar covalent bonds electrons are shared unequally because one atom has a stronger force of attraction than the other (EX. H2O). In a nonpolar covalent bond, the electrons are shared equally because they're electronegativity is also equal (EX. Cl2).
Overall, the atoms electronegativity determines the way it shares electrons