To activate your Windows server trial which gives you 180 days:
To renew your license for 180 days (can be done 3 times):
Note that if you don't activate your Windows on time each hour it will log you off and physically power itself down (a big pain for servers in a datacenter or remote location of any sort).
This works on basically all Windows server versions including 2008, 2012, 2016 and 2019 Server.
How To Check License Status and Expiration