Due to the large band-gap bowing associated with low N contents in III-V semiconductors, ternary and quaternary dilute nitride alloys have sparked interest over the last years for a wide range of technological applications. However, the realization of these alloys has been hampered by several challenges such as the extremely low equilibrium solubility of N and composition fluctuations. In order to overcome these challenges a detailed understanding of the growth of these alloys at the atomic level is crucial. Therefore, by employing state-of-the art first-principles calculations, this work provides (i) a detailed study of the thermodynamic N solubility limits at technologically relevant GaAs and InAs surfaces/subsurfaces as function of growth conditions, and (ii) the kinetic mechanisms for N adatoms that affect and control their incorporation, such as adatom diffusion and surface/subsurface substitution. A detailed analysis of the interplay between thermodynamics and kinetics allowed to predict the optimum conditions for N incorporation and to explain experimental results. This study provides a prototype for understanding the growth highly mismatched multi-component alloys.