If you change motherboard you can re install Windows 10 from a Version 1511 (November 2015) ISO or later. Doing this will accept your Windows 7 Or Windows 8 CD Key and re-activate when you connect to the internet.
That might not always work (when changing motherboard) however currently it does as Microsoft are still activating new Windows 10 installs which used a Windows 7 or 8 key, despite the free upgrade offer having ended.
The licence is tied to the hardware for the free upgrades however, so in the future if you change the motherboard you will have to purchase a new Windows 10 licence for that motherboard, however you then have a unique key, so if you change motherboard again after that you can call Microsoft up and activate with your purchased key.