It was kind of hard to get an example entity field query for drupal 8 that returns all the related content of an entity reference field. So here it is.
//Get how many you want
$counter = 1000;
$query = \Drupal::entityQuery('node');
$query->condition('status', 1);
$query->condition('type', 'your_bundle');
$query->condition('field_entity_ref',[777,888,999],'IN');
$query->sort('nid', 'ASC');
$query->range(0, $counter);
$nids = $query->execute();