Entering the product key in server 2012 sometimes is fraught with frustration. You can try to enter it with this command.
PS C:\Users\Administrator> slmgr -ipk XXXX-XXXX-XXXX-XXXX
and you get an error. The best way is to use this command.
PS C:\Users\Administrator> slui
This command opens the pictured GUI; this allows you to enter the product key. This works very well with Windows Server 2012 R2 9600.