How to find if a second-hand iPhone is stolen after purchase?
Restoring an iOS device will remove any record of a previous owner on the device.

If the device was purchased from an Apple Store, then Apple may have record of it being set up even if Find My iPhone. This also applies to other retailers, however I am not certain if this is possible.