We analyze soft and collinear gluon resummation effects at the N$^3$LL level for Standard Model Higgs boson production via gluon fusion $ggto H$ and the neutral scalar and pseudoscalar Higgs bosons of the minimal supersymmetric extension at the N$^3$LL and NNLL level, respectively. We introduce refinements in the treatment of quark mass effects and subleading collinear gluon effects within the resummation. Soft and collinear gluon resummation effects amount to up to about 5% beyond the fixed-order results for scalar and pseudoscalar Higgs boson production.