you should really contact Microsoft for a definitive answer.
https://www.microsoft.com/en-us/sql-server/sql-server-2022-pricing
SQLServer has two license models, core or cal.
in the core model, all physical cores on the server must be licensed. so you need 28 core licenses. there is an exception if hosted in a VM/Container. then only the cores exposed to VM/Container need to licensed (after the min 4 core, so a 2 core vm still needs a 4 core license ).
in the CAL model, you license the server, and license every device that connects even via a proxy service. so if a web server uses sqlserver, every device accessing the web server must have a cal license.
note: I don't believe SQLServer 2019/2022 enterprise supports a cal license, you must drop to standard or use a core license
so if you only want to license 20 cores, on your 28 core server, you need to use a VM or container to host the SQLServer and limit the VM/Container to 20 cores