Hi,
Did you change the motherboard when you say you rebuilt the PC?
Activation depends on what type of license you have of Windows 7/8/10.
If Windows 7/8/10 came preinstalled with the computer, that is called an OEM license. For an OEM license, the license dies as soon as the Motherboard dies. So, essentially, it is non-transferable. If that is the case, you need to get a new license.
However, this is not the same for retail licenses, i.e. you purchased the permit through the Microsoft store. That does carry transfer rights. If that is the case, please see the steps below:
Run the activation troubleshooter on the new device using the steps below:
Go to Settings>Update and Security>Activation and run the troubleshooter. For Windows 11, it is Settings > System > Activation.
Concurrently, select I recently changed hardware on this device.
(Please note that the Activation troubleshooter requires you to have a digital license linked to a Microsoft Account.)
I hope you find this information useful. If you have any more questions, don't hesitate to reach out. Otherwise, please take a moment to rate the thread. Wishing you good luck!