When running the Microsoft SharePoint 2016 Products Prepartion Tool (better known as Prerequisites Installer) on a Windows Server 2012 R2 it may fail with the following error:

There was an error during installation.
The tool was unable to install Application Server Role, Web Server (IIS) Role.
Last return code (0X3E8=1000)

In most cases this behavior is caused by missing server side binares for features like .NET Framework. To solve this issue just run the following PowerShell command to enable the Server features required by SharePoint 2016. Replace the path to your local copy of the Windows Server 2012 R2 binaries at the end of the code (highlighted in green).