There are a couple of issues here. the phone can be restored to factory settings using these instructions—>If you forgot the passcode on your iPhone, or your iPhone is disabled - Apple Support.
If it asks for an Apple ID and password after doing that the phone is activation locked. The Apple ID email address and password that were used to set it up will be required to continue setup. Note that the Apple ID looks like an email address, but it is really just a user ID; the email account does not need to be active to use it to meet the requirements of Activation Lock.
The next issue is 2 factor authentication. If it is enabled for the Apple ID then you will need to be able to receive an authentication code to the phone; again, it does not need to be to the Apple ID, it will be sent as a message to the phone.
Once you have set it up you can change the Apple ID for the account—>Change your Apple ID - Apple Support
If this sounds too complicated use the Contact Support link at the top of this page to communicate with an Apple technician who can walk you through the process, or make a Genius Bar appointment if you have any local Apple stores that are open—>https://www.apple.com/retail/geniusbar/