How can I get the Register form on the front page?
The correct form id shoud be Drupal\user\RegisterForm. However, because the register form is attached to an entity, you can't use getForm directly. You need to create an entity and then get the register form for that entity.

The role of the preprocess function is to add / modify / delete template variables via the $variables parameter, so you need to add the form to that array rather than return it.

Something like this should work:

function themename_preprocess_page(&amp;$variables) {  
  $entity = \Drupal::entityManager()
    -&gt;getStorage('user')
    -&gt;create(array());

  $formObject = \Drupal::entityManager()
    -&gt;getFormObject('user', 'register')
    -&gt;setEntity($entity);

  $form = \Drupal::formBuilder()-&gt;getForm($formObject);
  $variables['register_form'] = $form;
}


Now you should be able to print the form via {{ login_form }} in the page.html.twig template.