Likely a bad motherboard if it turns on at times, maybe a bad charger. Try removing the CMOS battery from the motherboard if it has a removable one, unplug battery and wall power, hold in power button for about 30 seconds. Plug in only wall power and see if it turns on. If it does, replace the CMOS battery and try it again. If it does not turn on, try a new CMOS battery. If that does not work but it worked OK the first time without a CMOS battery, motherboard is bad. Also can try removing the RAM, if system does not beep when you try to turn it on, that is also a sign of a bad motherboard.