At constant volume,the heat change is $q_{V} = \Delta U$.
At constant pressure,the heat change is $q_{p} = \Delta H$.
At constant pressure,the enthalpy change is defined as $\Delta H = \Delta U + p\Delta V$.
Where $\Delta V$ is the change in volume,$V_{1}$ is the initial volume,and $V_{2}$ is the final volume.
$\Delta H = \Delta U + p(V_{2} - V_{1}) = \Delta U + (pV_{2} - pV_{1})$ ... $(i)$
According to the ideal gas equation,$pV = nRT$.
For reactants: $pV_{1} = n_{1}RT$ ... $(ii)$
For products: $pV_{2} = n_{2}RT$ ... $(iii)$
Where $n_{1}$ is the number of moles of gaseous reactants and $n_{2}$ is the number of moles of gaseous products.
Substituting equations $(ii)$ and $(iii)$ into equation $(i)$:
$\Delta H = \Delta U + (n_{2}RT - n_{1}RT)$
$\Delta H = \Delta U + (n_{2} - n_{1})RT$
$\Delta H = \Delta U + \Delta n_{g}RT$
Where $\Delta n_{g}$ is the difference between the number of moles of gaseous products and gaseous reactants.
If $\Delta n_{g} = 0$,then $\Delta H = \Delta U$.
If $\Delta n_{g} > 0$,then $\Delta H > \Delta U$.
If $\Delta n_{g} < 0$,then $\Delta H < \Delta U$.