The standard model (SM) production of four top quarks ( t t ¯ t t ¯ ) in proton-proton collisions is studied by the CMS Collaboration. The data sample, collected during the 2016-2018 data taking of the LHC, corresponds to an integrated luminosity of 137 fb - 1 at a center-of-mass energy of 13 TeV . The events are required to contain two same-sign charged leptons (electrons or muons) or at least three leptons, and jets. The observed and expected significances for the t t ¯ t t ¯ signal are respectively 2.6 and 2.7 standard deviations, and the t t ¯ t t ¯ cross section is measured to be 12 . 6 - 5.2 + 5.8 fb . The results are used to constrain the Yukawa coupling of the top quark to the Higgs boson, y t , yielding a limit of | y t / y t SM | < 1.7 at 95 % confidence level, where y t SM is the SM value of y t . They are also used to constrain the oblique parameter of the Higgs boson in an effective field theory framework, H ^ < 0.12 . Limits are set on the production of a heavy scalar or pseudoscalar boson in Type-II two-Higgs-doublet and simplified dark matter models, with exclusion limits reaching 350-470 GeV and 350-550 GeV for scalar and pseudoscalar bosons, respectively. Upper bounds are also set on couplings of the top quark to new light particles.