Nitrogen gas has a chemical formula of N₂, hydrogen gas is H₂ and ammonia is NH₃. If you see the reaction, it would be
N₂ + H₂ → NH₃
You should note that the fundamental laws of nature must apply. According to Dalton's Atomic Theory, one of its postulates states that each compound is composed of a fixed ratio of the number of its individual atoms. This is where the Law of Definite Proportions is coming from. In order to obey this law, you must balance the equation such that the number of moles of each element in a reaction is equal for both sides of the reaction. Thus, the balance reaction is
N₂ + 3 H₂ → 2 NH₃
Thus, the coefficient of Nitrogen is 1.