Oxidation number for nitrogen in ammonium sulfate
Ammonium sulfate is an ionic compound, composed of two ammonium ions ($\ce{NH_{4}^{+}}$) and one sulfate ion ($\ce{SO_{4}^{2-}}$). As such, you can neglect the sulfate entirely from your consideration of the oxidation state of the nitrogen, as well as treating each ammonium ion as a separate entity. Given the total charge on the ammonium cation, it should be easy to see why the nitrogen has the specified oxidation state.