1. Alkali metals (Group 1): These metals, like lithium (Li), sodium (Na), and potassium (K), have a strong tendency to lose one electron to form a +1 cation. Hydrogen, in the presence of these metals, gains one electron to form a -1 anion (hydride ion, H⁻). This results in ionic compounds like lithium hydride (LiH), sodium hydride (NaH), and potassium hydride (KH).
2. Alkaline earth metals (Group 2): These metals, like beryllium (Be), magnesium (Mg), and calcium (Ca), lose two electrons to form +2 cations. Hydrogen, again, gains one electron to form a hydride ion (H⁻), and two hydride ions are required to balance the +2 charge of the alkaline earth metal. Examples include beryllium hydride (BeH2), magnesium hydride (MgH2), and calcium hydride (CaH2).