How do I use an image CAPTCHA?
Captcha is not a valid form element in Drupal 8. Since you haven't listed if you are using any other contributed modules, I am not sure what or where #type =&gt; captcha comes from.

I advise using Mollom to do captcha handling for forms.

https://www.drupal.org/project/mollom