I have had a few questions about how to do all clean installation of Windows 10 and make sure it activates correctly. It is quite easy, but you need to do the work 2 times.
What you need to do is to simply first upgrade your existing Windows 7 or 8 installation and make sure it shows as activated. At this time your machine has generated a unique ID with Microsoft. This ID is connected to your hardware and not your Microsoft Account. This is a good thing, so that if you at a later point should sell your machine the license will follow the machine.
From now on it is just to make a bootable USB stick, start installation, format your drive and go through setup. You will be asked for key a couple of times, but no worries, just skip and continue. When Windows 10 is installed it will activate itself. Just remember to use ISO with same SKU (home or pro) as your original Windows 7 or 8 installation.