@CallmeNoob
From the little info I could find on this model PC, it came out in 2012 -- so being that old, there is a strong likelihood that it will not run Win10 well, if at all. So, you could try forcing that onto it, but do not be surprised if it does not work.
You said you have a product key, but what version of Windows is it for?
You said you tried lots of things, so we have no way of providing you advice without repeating lots of stuff you have already heard. Need to know specifically, what version of Windows did you try to install, how did you go about doing that, and what errors did you run into in the process.
I am a volunteer and I do not work for, nor represent, HP