In case of formation our desired reaction is N2 + 2H2 -> N2H4
In such type of questions multiply all the reaction with some variables say p,q,r,s.
After multiplication add those reactions, you'll find a single reaction equation. Equate its coefficients to our desired reaction.
In case of formation I got p = -1/4, q = 3/4, r = 1/4, s = -1/4
so enthalpy of formation = -1010/4 + (3/4)(317) + 413/4 - 286/4 = 17 kJ
Similarly you can do it for combustion reaction.