Flexi Says: Ionic bonds form only between metals and nonmetals. Metals "want" to give up electrons, and nonmetals "want" to gain electrons. Fluorine is a halogen in group 17. It has seven valence electrons. If fluorine gains one electron, it will have a full outer energy level. After sodium gives up its valence electron to fluorine, both atoms have a more stable arrangement of electrons.