Or, if you already have a qualifying product that is no longer being used on another system, at all, that was legitimately activated itself, meaning Windows 7 or 8, you USUALLY (Nearly always) use that product key to activate Windows 10 however once you do then that product key will no longer be valid for any system which was previously using that product key.
If you do not currently have a valid Windows 7 or 8 product key that is not in use, then as already said, you need to purchase one.