Hello remona160,
If I'm understanding you right, you're unable to sign into the App Store on your iPhone, and it appears as if you're stuck in a sign in loop. I'm sure you're anxious to get some apps downloaded to that new iPhone, and I'm happy to help you in doing so.
The first thing I would recommend doing is powering your iPhone off and then back on: Restart your iPhone. Restarting is a simple step that can help solve a wide variety of issues and will allow you to start with a clean slate when trying to sign in again. Instead of signing in directly in the App Store after the restart, try signing in by going to Settings > iTunes & App Store.
If you continue to experience the same thing in Settings, it may be possible your iPhone is having trouble connecting to the servers. The steps in the following support article may be helpful: If you can't connect to the App Store, iTunes Store, or Apple Books.
Respond back if you need continued help with this.
Thanks for using Apple Support Communities.
Take care.