“Find My iPhone” needs to be disabled before you sell your phone. You can do this from your device or remotely in iCloud. Here’s how to turn it off from your device:
1. Open your Settings icon on your device’s home screen:
2. Tap iCloud in the Settings menu:
3. If you see that Find my iPhone is turned on, tap the button to turn it off:
4. A pop up window will appear requesting your Apple ID and password. Enter it, then tap Turn off to confirm:
5. Then scroll down and tap the red "Sign Out" text to remove your iCloud account from the device.
6. To erase your iPhone, iPad or iPod Touch: Tap the Settings menu, scroll down and tap General, then scroll down and tap Reset. In the reset menu, tap "Erase All Content and Settings"