This would be an ionic bond. Ionic bonds form between metals and nonmetals due to the relatively large different in electronegativities where nonmetals are more electronegative than metals. This difference in electronegativities makes it so that the metal gives up the electron to make an octet and the nonmetal gains the electron to make an octet (there is no sharing of the electron). The metal becomes a cation while the nonmetal becomes a anion and their opposite electric charges keep them together.
I hope this helps let me know in the comments if anything is unclear.