Just to expand on the previous answer.
Microsoft made the free upgrade from Windows 7/8 to Windows 10 during 2015 to 2016 and described the offer as for the life of the device. This means if you change the major hardware (motherboard) it is a new device and the Windows 10 licence is not transferrable to that new device.
The free upgrade form Windows 10 to Windows 11 is using an original Windows 10 licence upgrade to Windows 11.
You will need a new licence to activate Windows 11.