i believe the previous owner had just lost them
Okay so first, thanks for staying with us - I say that cause sometimes when new peeps come in with computer problems, some answers can come off unintentionally abrasive.
Anyway - 2nd. Thanks for posting pics. So many times we get questions about problems, then we be nice hoping for a pic. Then someone asks for a pic. And then we never hear anything again.
Okay so that big ramble was me trying to soften the blow.
I'm assuming someone built this machine for you? Or you bought it from someone? In either case, they.... to be nice... was it also their first build?
Motherboard standoffs are one of those things that - seriously - gets overlooked by EVERY build guide, and its SUPER UBER COMMON for first time builders to overlook because it's not obvious at all what those brass things are for that came with the case. To add to the confusion there are some cases that don't use them! But it's one of those things that... seems forgotten to mention in build guides because experienced builders it's easy to overlook them as "oh yea those of course do X" but for first time builders there's no way they'd know that. And they really are critical.... but as a first time builder, again how would you know????
But in your case... it's even more confusing! Obviously the prior builder knew enough to put SOME in... but... not all of them? More scary is - so okay on an average computer case that has standoffs - the case is made to be universal and accommodate mounting several different sizes of motherboards. Well, it's possible to put standoffs in places where a given board
doesn't have a hole... which means you have a brass metal standoff against the back of your motherboard - and if there happen to be conductive traces there - it's a short.
The second death is... so many times the screws you would normally use to secure the motherboard into a brass standoff (depends on case)... commonly those screws can be the same threading as what the standoff uses to screw into the case backpanel itself (the motherboard tray). Which in english means if you forget the standoff entirely the screws will quite happily thread the motherboard directly into the metal of the case's motherboard tray itself. That's also a direct short (plus flexing the board) ... BUT... you might get lucky if the motherboard tray is painted... but that paint won't last long at all if the motherboard moves around, and those spikey solder points grind their way through.
And that's a long way to say I think that might of happened to you.
I think when you first got the computer, whoever assembled it got lucky - because of how precariously the mobo is mounted when you went to take the heatsink off that was probably enough flex to scrape through that thin paint layer and cause all hell to break loose.
And again, that's not your fault - someone put that system together wrong.
ALSO the fact you were having CMOS/BIOS/UEFI problems - that's a classic symptom of the board being shorted out somewhere which... 90% is caused by shitty mounting.
So... to try and fix your problem.
First off, because we can't trust that the original builder didn't put standoffs in places they shouldn't be, you need to pull the motherboard out. If you need more info on that, please ask here for more info.
2nd
I'd go kick the shit out of whoever lost the standoffs, screws, for your case Depending on what you find, well first thing is powering up the guts of your system OUTSIDE of the case to make sure it's still alive.
Okay so I'll stop here. I've gone on enough and I think the alcohol is interacting a bit much for me as I think about whoever assembled this system for you
f*cked you over must have misplaced like 15 parts of your case.
The good part is there are cheap ATX mounting standoff kits you can buy, and there's a fair chance your motherboard still is okay - but the fact that your computer currently shuts immediatly off means hopefully your power supply's anti-suicide protection is kicking in and things are still trying to work - but it also means your PSU's suicide protection is kicking in! Which if you do that enough times something is going to pop!
Anyways hopefully others here can chime in and verify a good plan of action. Seeing those mounts though, you gotta pull that board (again, if you need/want help ask! It's easy and honestly you're gonna be more knowledgeble about the system than the builder was at this point!!!)
PS - last bit added. Okay so out of paranoia, wanted to add if it happened to be YOU were the one that assembled the machine - totally ignore my anger above and give yourself a high five for ballerin' it and putting a system together. The anger would only be if someone put this together and ran - which I doubt. If it's more something like a helpful relative or friend doing this in good faith that's all chill, and honestly the fact that the system ran at all originally just shows how robust PC hardware is nowadays.