iPhone 6 restarts randomly only when in iOS
I have an iPhone 6 that i got from my brother when he upgraded to a new phone. It would randomly Restart so i thought it might be a bad battery. Replaced it, still restarts. Updated iOS, still did it. Factory Reset, still does it. Now to the title, what i mean by it is, when it's in iOS it will restart every like 3-4 minutes but if its installing updates, restoring, in recovery mode, etc. it's fine. Everything is pointing me to a software problem but is there something i could be missing? It was dropped in water prior to me getting it for like a second but there are no signs of water damage to the Logic Board. Any help is appreciated, thanks in advanced.
iPhone 6