The source of these two nitrogen atoms are ammonia (NH₃) from nitrogen compounds (mostly metabolism of amino acids) through which excess nitrogen is eliminated from organisms. This process is called urea cycle, which extracted nitrogenous wastes.
The liver forms it by combining two ammonia molecules with a carbon dioxide molecule.