Drupal 8, entityQuery with operand "AND" for a multiple values field
I'm not sure if you can do that using an entity query.

You could specify the delta explicitly:

\Drupal::entityQuery('node')
  -&gt;condition('field_tags.0.target_id', 1)
  -&gt;condition('field_tags.1.target_id', 2)
  -&gt;execute();


But of course that would only match if the ids are used in those specific deltas.

You probably need to use raw SQL for this, see https://stackoverflow.com/questions/3918351/sql-query-ensure-a-row-exists-for-each-value-in for the basic approach on how to do this.