IPhone 5s not charging and can't restore on iTunes?

My iPhone 5s stopped charging normal (didn't make a sound or show charging symbol) I tried to see any lint, hard reset, nothing works, so I tried to restore it but iTunes never found the the iPhone and my windows says the "USB has malfunctioned and doesn't recognize it" I tried to install a driver but never install just failed all the time
The only way to charge it is when it's off but when it's off and plug in the charger it powers back on. Any help?

Reset the iPhone hold down the home button and the lock button and the same time until it powers off and powers back on. This should resolve your problem if it doesn't work I would take it to an apple store.