Sodium Oxide
The electron configuration of #"Na"# is (2, 8, 1). It can achieve a noble gas octet by donating its outer electron to another atom.
The electron configuration of #"O"# is (2, 6). It can achieve a noble gas octet by accepting an electron from each of two sodium atoms (excuse my hand-drawn diagrams).
The opposite charges create electrostatic attractions between the #"Na"^+# and #"O"^(2-)# ions.
Calcium Sulfide
The electron configuration of #"Ca"# is (2, 8, 8, 2). It can achieve a noble gas octet by donating its two outer electrons to another atom.
The electron configuration of #"S"# is (2, 8, 6). It can achieve a noble gas octet by accepting two electrons into its outer shell.
The opposite charges create electrostatic attractions (ionic bonds) between the #"Ca"^(2+)# and #"S"^(2-)# ions.
Hydrogen Bromide
The electron configuration of #"H"# is (1). It can achieve a helium configuration by sharing its outer electron with another atom.
The electron configuration of #"Br"# is (2, 8,18, 7). It can achieve a noble gas octet by sharing an outer electron with #"H"#.
The sharing of electrons makes a covalent bond.
Ethene
The electron configuration of #"H"# is (1). It can achieve a helium configuration by sharing its outer electron with another atom.
The electron configuration of #"C"# is (2, 6). It can achieve a noble gas octet by sharing its outer electrons with other atoms.
The sharing of two electrons makes a covalent #"C-H"# bond. the sharing of four electrons makes a covalent #"C=C"# double bond.