  The rate for Higgs (H) bosons production in association with either one (tH)
or two ($\mathrm{t\bar{t}}$H) top quarks is measured in final states containing
multiple electrons, muons, or tau leptons decaying to hadrons and a neutrino,
using proton-proton collisions recorded at a center-of-mass energy of 13 TeV by
the CMS experiment. The analyzed data correspond to an integrated luminosity of
137 fb$^{-1}$. The analysis is aimed at events that contain H $\to$ WW, H $\to$
$\tau\tau$, or H $\to$ ZZ decays and each of the top quark(s) decays either to
lepton+jets or all-jet channels. Sensitivity to signal is maximized by
including ten signatures in the analysis, depending on the lepton multiplicity.
The separation among the tH, the $\mathrm{t\bar{t}}$H, and the backgrounds is
enhanced through machine-learning techniques and matrix-element methods. The
measured production rates for the $\mathrm{t\bar{t}}$H and tH signals
correspond to 0.92 $\pm$ 0.19 (stat) $^{+0.17}_{-0.13}$ (syst) and 5.7 $\pm$
2.7 (stat) $\pm$ 3.0 (syst) of their respective standard model (SM)
expectations. The corresponding observed (expected) significance amounts to 4.7
(5.2) standard deviations for $\mathrm{t\bar{t}}$H, and to 1.4 (0.3) for tH
production. Assuming that the Higgs boson coupling to the tau lepton is equal
in strength to its expectation in the SM, the coupling $y_{\mathrm{t}}$ of the
Higgs boson to the top quark divided by its SM expectation, $\kappa_\mathrm{t}$
= $y_\mathrm{t} / y_\mathrm{t}^\mathrm{SM}$, is constrained to be within $-$0.9
$\lt$ $\kappa_\mathrm{t}$ $\lt$ $-$0.7 or 0.7 $\lt$ $\kappa_\mathrm{t}$ $\lt$
1.1, at 95% confidence level. This result is the most sensitive measurement of
the $\mathrm{t\bar{t}}$H production rate to date.
