  A data sample of events from proton-proton collisions with at least two jets,
and two isolated same-sign or three or more charged leptons, is studied in a
search for signatures of new physics phenomena. The data correspond to an
integrated luminosity of 137 fb$^{-1}$ at a center-of-mass energy of 13 TeV,
collected in 2016-2018 by the CMS experiment at the LHC. The search is
performed using a total of 168 signal regions defined using several kinematic
variables. The properties of the events are found to be consistent with the
expectations from standard model processes. Exclusion limits at 95% confidence
level are set on cross sections for the pair production of gluinos or squarks
for various decay scenarios in the context of supersymmetric models conserving
or violating R parity. The observed lower mass limits are as large as 2.1 TeV
for gluinos and 0.9 TeV for top and bottom squarks. To facilitate
reinterpretations, model-independent limits are provided in a set of simplified
signal regions.
