Sulphur and fluorine are non metals. Nonmetal atoms combine by the sharing of electrons. This is also called a covalent combination(bond).
In BaBr2, a metal is combined with a nonmetal. This combination involves a transfer of electrons from the metal to the nonmetal forming an ion pair. This is otherwise called an ionic bond.
Atoms of a metal are held together by strong metallic bonds that involves positively charged cations and a cloud of electrons.