The ON/OFF switch on a PC is an momentary switch. When you turn on the PC the switch does not stay solidly on, it just sends a blip when you press it. Sometimes these switches fail. Suggest follow the wire from the switch to the MB. Remove the switch wire from the MB and short across the pins for a 1/2 second. The PC should boot. If the problem with powering on/off goes away then it was the switch. Use google to find better directions on powering on PC w/o a switch or post.
EDIT: also verify that your CPU fan is turning. If the CPU fan doesn't turn most MBs drop power right away. Older CPU fans sometimes start slow and do not hit the required RPMs until they warm up. Best way to test this is to turn off CPU fan monitoring in the BIOS (if it lets you) and see if the problem goes away. Second best way is to visually inspect the CPU fan and make sure it is turning. Terrible way to test this is pull the CPU fan wire and burn up your CPU - don't do that.
Assuming not a failed switch a failed MB can also cause this. As can a shorted wire, a failed card, etc. You need to debug.
Normal debugging is to pull parts until the "shutdown 2 seconds after being turned on" goes away, then add back parts until it comes back. For example, pull the video card. If the PC beeps 'no video' but does not "shutdown 2 seconds after being turned on" then strongly suspect the video card.
Typical order to pull parts is:
1. Anything USB, firewire, eSata, network attached. then test.
2. leave previous parts out of pc, pull any PCI cards that you have (video, capture, sound, etc.). Remember there is a catch at the back end of the video card. Release that catch, do not just pull up until something breaks. then test.
3. Leave all previous parts out, pull memory then test
4. leave all previous parts out pull both sata and power cables to disk, optical drives then test.
At this point you have a bare MB with CPU and Power supply. If that still "shutdown 2 seconds after being turned on" then replace the MB - you have already replaced the PSU.
Note if you built the PC yourself there is a chance of crimped wires shorting or of bad use of stand-offs letting the MB short against the case. Pull the MB from the case and put on a piece of cardboard. Then test the PSU and MB+CPU to test outside the case to see if you still have the shutdown 2 seconds after being turned on.
Good Luck.
EDIT: If you end up needing to replace the MB, look also at upgrading MB, Memory and CPU. Compare buying a LGA775 MB to buying an to buying a newer CPU, MB and memory and see if the extra $ for a the newer parts make sense.
Yet another EDIT: I've been assuming that the "reboot after 2 seconds" is before windows boots. Prove that by trying to power on to BIOS. If you can get to BIOS w/o the 'reboot after 2 seconds' and sit there consistently without problems then we are looking at the wrong stuff and should focus on ruling out software problems with a diag boot cd/usb.