See Turn off Activation Lock https://support.apple.com/en-us/HT201441See this heading If you erased your own device. It says: "If you don't sign out of iCloud before you put your device in recovery mode and restore, it might remain in Activation Lock. That means you need to enter the same Apple ID and password that … was used when … [the device was last set up]."
To recover the needed credential(s),
See: If you forgot your Apple ID https://support.apple.com/en-us/HT201354 and
If you forgot your Apple ID password https://support.apple.com/en-us/HT201487
You also can use Having trouble signing in/iForgot https://iforgot.apple.com/password/verify/appleid
If you have iOS 11 or later and your account is protected with two-factor authentication, you can turn off Activation Lock with your device Passcode. Tap Unlock with Passcode, then tap Use Device Passcode."
_________
1. Note that no one but the person that last set up the device will be successful in following the above instructions. So, if you are not that person, you will need to get the required password from the person that last set it up.
2. If you are the last person that set it up and can't follow the instructions above successfully, then you will need to have your original purchase receipt for the device with the device’s serial number on it and contact Apple Support.
2. The original purchase receipt could have been obtained through Apple or an authorized Apple reseller.
See these support options:
Get a call from Apple support to help solve your problem using this link https://getsupport.apple.com/?caller=kbase&PGF=PGF63005&category_id=SC0245&symptom_id=23362
Apple ID Support https://support.apple.com/apple-id
Apple ID account security for country-specific and
region-specific help https://support.apple.com/en-us/HT204169
Get Support: We’re here to help https://getsupport.apple.com/. Go through the options to find the best support option.