Note that the Windows Server 2012 operating system does not have TLS 1.2 enabled by default so the license activation "Error 51404" failure is most often observed with that operating system, but it can occur for other operating systems as well.
To enable TLS 1.2 open 'Control Panel' and select 'Internet Options', then under the Advanced tab scroll down to the Security section and check the “Use TLS 1.2” option. Click OK to save the settings.
The license can fail to activate with the same message if the most recent Windows Updates are not installed for the computer or if the Firewall settings are blocking access to the internet via port 443. Therefore if enabling the 'Use TLS 1.2' option does not resolve the problem, ensure that the latest Windows Updates are installed and check to see that the Firewall is allowing internet traffic via port 443.
To see if you have network access to the license activation server, you can peform the following tests...
Try to ping the license activation server by opening a Command Prompt window and entering the command line...
If the ping request is unsuccessful this indicates that your network is unable to communicate with the license activation server.
This should return an xml document. If an error is returned by Internet Explorer when connecting to the URL this indicates that access to the license activation server is likely being blocked by a firewall setting or there is no internet access from that system.
If the security settings at your site prevent connecting to the internet, then the use of Activation ID based licenses that require internet activation will not be possible. In that you will need to use an offline license instead. An offline license uses a certificate based license (.lic file) that does not require an internet connection. Instructions for creating an offline license can be found in the Knowledge Base article: How to claim an offline 2018 license from the Licensing Portal?