I bought a Gaming Computer from a friend that broke on him and I have been trying to fix. When you turn it on it will light up fans will go and only start for a second then shut down. Sometimes it will start up but if it has been turned off for a few hours it goes back to not starting again. I've swapped out the RAM, SSD, Graphics Card and Power Supply to test and have had the same issue. I brought it to a PC repair shop and they told me the issue was the Motherboard. I got a used motherboard online and rebuilt the machine. Got the same exact thing with it only starting for a second then turning off. Could it be my CPU at this point?
CPU-i7-4790K
Motherboard - Sabertooth Z97 Mark 1 or Gigabyte Z97X UD5H
PSU- AX860
Graphics card- Geforce GTX 1080 PCI express 3.0
SSD- 960 EVO Sata 6 Gb/S
Ram- 2X Vengeance Pro DDR3 2X4
CPU cooler- Bequiet Rock Pro 4
CPU-i7-4790K
Motherboard - Sabertooth Z97 Mark 1 or Gigabyte Z97X UD5H
PSU- AX860
Graphics card- Geforce GTX 1080 PCI express 3.0
SSD- 960 EVO Sata 6 Gb/S
Ram- 2X Vengeance Pro DDR3 2X4
CPU cooler- Bequiet Rock Pro 4