Change teaser template based on a field
You can't change the template in preprocess, there's a separate hook for that, hook_theme_suggestions_template()

This is what node is doing for the node template:

/**
 * Implements hook_theme_suggestions_HOOK().
 */
function node_theme_suggestions_node(array $variables) {
  $suggestions = array();
  $node = $variables['elements']['#node'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');

  $suggestions[] = 'node__' . $sanitized_view_mode;
  $suggestions[] = 'node__' . $node-&gt;bundle();
  $suggestions[] = 'node__' . $node-&gt;bundle() . '__' . $sanitized_view_mode;
  $suggestions[] = 'node__' . $node-&gt;id();
  $suggestions[] = 'node__' . $node-&gt;id() . '__' . $sanitized_view_mode;

  return $suggestions;
}


You can provide something similar. Note that when you do this in a template, you have to use the alter hook, like this example from the bartik theme:

/**
 * Implements hook_theme_suggestions_HOOK_alter() for form templates.
 */
function bartik_theme_suggestions_form_alter(array &amp;$suggestions, array $variables) {
  if ($variables['element']['#form_id'] == 'search_block_form') {
    $suggestions[] = 'form__search_block_form';
  }
}