If you purchased the Windows 8 upgrade from Windows 7, but would rather do a clean install, here’s a method that I’ve found that has been reported to work.
First, obviously, delete all partitions during the Windows install, supplying your key when requested.
After Windows 8 installs, and if Windows won’t activate, do the following:
Run regedit, and set:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE\MediaBootInstall
to 0 (zero)
Open an administrator-level command prompt, and run the following:
slmgr /rearm
Then reboot and run activation again.