See these Apple reads on activation lock and the quoted information below.
Activation Lock for iPhone, iPad, and iPod touch https://support.apple.com/en-us/HT201365 “Find My includes Activation Lock—a feature that's designed to prevent anyone else from using your iPhone, iPad, or iPod touch, if it's ever lost or stolen. Activation Lock turns on automatically when you turn on Find My [device].”
Turn off Activation Lockhttps://support.apple.com/en-us/HT201441“If you erase your device without signing out of iCloud first, it might still be protected by Activation Lock. Whether you erased your own device or bought one from someone else, you can turn off Activation Lock by entering the correct Apple ID and password.”
Note that the correct Apple ID and password is the combination allowed by the person owning the device when lost of stolen. If this combination cannot be entered, then the phone is useless to a non-owner with the possible exception noted below.*
If you can't activate your iPhone https://support.apple.com/en-us/HT201407 "If your iPhone can't be activated or an alert says the activation server is unavailable or the SIM card is unsupported, learn what to do.”
*Apple may not help unlock a phone without the owner being present and seeing the phone’s serial number on the owner’s purchase receipt. But if you (not the owner), take the receipt to a brick and mortar Apple Store, then a Genius may be willing to provide help in unlocking the phone. Make a genius bar appointment using this link https://www.apple.com/retail/geniusbar/) Also, if the prior owner has passed away, then take evidence of death, a will, or anything else that would help you establish that you now are the rightful owner.