The atomic number of nitrogen is 7, while the atomic number of hydrogen is 1. When nitrogen and hydrogen bond, they typically form a covalent bond.
In a covalent bond, atoms share electrons to achieve stability. In the case of nitrogen and hydrogen, nitrogen has five electrons in its outer shell and needs three more to complete it, while hydrogen has one electron and needs one more. By sharing electrons, nitrogen and hydrogen can achieve a more stable electron configuration.
For instance, in ammonia (NH3), nitrogen shares its electrons with three hydrogen atoms. This sharing of electrons allows both elements to reach a stable state, which is characteristic of covalent bonding.