The first one you look up the heats of formation of MgCl2, H+(aq), and MgO ( Δ H3 is Heat of formation of liquid water). Both HCl and MgCl2 are present as ions (Cl- is a spectator)
ΔH1 = Hf,H2O+Hf,Mg2+(aq) - 2Hf,H+(aq) - Hf,MgO
ΔH2 is also the sum of the moles of products times the molar heats of formation of the products minus the sum of the moles of reactants times their heats of formation.
Remember that Hf of H+, H2, and Mg2 are all 0 by definition.