Hello @JOAO DUARTE DE AZEVEDO
After Windows Server 2016 is not anymore enough to install the licenses but you need to ensure that the RD Licensing Server role is installed and configured, in order to communicate those licenses to the RDSH.
Please check the next guide how to install and configure:
https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-activate-license-server#:~:text=Install%20the%20RD%20Licensing%20role,-Sign%20into%20the&text=In%20Server%20Manager%2C%20click%20Roles,Licensing%2C%20and%20then%20click%20Next.
Hope this helps with your query,
--
--If the reply is helpful, please Upvote and Accept as answer--