Chosen Solution

My iPhone dropped on the floor. There is a sound coming from inside the device when I shake it. My device won’t charge past 2 percent

The phone will have to be opened. You can try this yourself or have a repair shop do it for you. Check out this guide to see if you are comfortable with the necessary actions. Obviously, you will want to identify what is shaking around inside the device. This could be unrelated to your charging issue but I suspect it will have some correlation. You need to look for a properly connected battery first. If that looks good, you could try a replacement battery. Anything beyond that brings you to the logic board and the charging circuit.