How to disable Activation Lock on an iPhone
1. Find "iCloud" in your "Settings" and tap on the top menu, labeled with your name.
2. Click "Find My iPhone" and slide to the "off" position. You'll be prompted to enter your Apple ID password.
3. At the bottom of that page, click "Sign Out," and then you may return to "Settings" for the next step.
How to reset an iPhone to its factory settings
1. In "Settings," tap "General."
2. At the bottom of the "General" page, find and click "Reset." Don't worry: there are still a few steps before your info is wiped from the phone.
3. You can choose between an array of resetting options. Here, you can reset features such as your home screen layout or dictionary, but to restore its factory settings, "Erase All Content and Settings" will do the trick.
4. You'll be prompted to enter your passcode, then your device will double-check that you want to erase everything and if you do, then tap "Erase."
5. This could take a few minutes, depending on how much you have stored on your iPhone, but once the deletion is completed, your device will restart as new.