How to do an EntityQuery on a custom User field?
I think you might be missing a line:

$ids = \Drupal::entityQuery('user')
  -&gt;condition('field_country', 'Canada')
  -&gt;execute(); // This returns the user ids

// Load the users
$users = User::loadMultiple($ids);
foreach ($users as $uid =&gt; $user) {
    // $user contains the $user entity
}


More examples are located on the docs page.