Chemical bonds form when positively charged atomic nuclei attract negatively charged electrons. Compounds are formed when two or more different atoms combine through chemical bonds, such as carbon dioxide (CO2) and water (H2O). Valence electrons are in the outermost shell and atoms seek stable arrangements of 8 electrons through bonding. Ionic bonding occurs through the transfer of electrons between metals and non-metals to form positively charged ions and negatively charged ions that are attracted to each other.