If you want to factory reset it just turn it off, hold down the power and volume keys. This should take you to the phone's BIOS. Use the volume keys to navigate around the BIOS and the power button to select 'factory reset'.
Try holding down the on button and the volume button(s) at the same time when the phone is off. I'm not sure if this works for apple but it worked for my alcatel. If it works you should see the phone's BIOS where you have a few things you can do without the operating system (this is also how you ROOT your phone). What you're looking for is the 'factory reset device' option. Use the volume up/down to select the option and the power button to use it. This should factory reset your phone. After that your phone should work normally however I can't guarantee this will work. Good luck.
I'm not sure but it might be some kind of error in the operating system. It could be that the phone simply has problems with measuring the battery percentage and therefore it thinks that the battery is at 0%. To avoid a system crash (or whatever it's called) phones usualy turn off when there still is some power in the battery so, despite a full charge, your phone will still turn off. This probably happened due to a virus. In my opinion, the best way to deal with it is to back up your data and factory reset your phone. It might not work so only do it if you don't find another answer to your problem. PS. My sister had a problem with her phone. The home button would not work. The factory reset fixed this.