Well, there is really no way to stop people from distributing your game illegally (if they can play offline). Any product key that can be redeemed offline means that it can also be used my anyone that knows it, which allows it to be shared on the internet. You could of course only allow them to play once they have verified it online, but this causes problems which is the reason most software does not require this. If you publish your game to steam, they have their own system for this that can help you out.