Go through this help guide to understand activations (license transfer) when you change hardware and how to activate if you meet the criterion. Following are the cases -
Always Allowed: Replacing a Motherboard Because It’s Broken
Never Allowed: Moving a Preinstalled License to a New PC
Always Allowed: Moving a “Full Version” or “Retail” License to a New PC
Maybe Allowed: Moving an “OEM” or “System Builder” License to a New PC
Never Allowed: Moving a Windows 10 Upgrade “Digital Entitlement” to a New PC