Strict terms query (exclusive)

Hi, I am looking to make a terms query but strictly containing specified terms and excluding all docs that do not contain only those terms (eg. docs matches if I have strictly and only A and B => no doc matches if I have only A, or only B, or A and B and C, ...). I did not find in terms, terms set, filters, ...
Thank you in advance for your help :wink: