But actually, you have several tips to reset iPhone passcode:
Use iCloud: Sign in iCloud.com with apple ID and password, then all idevice with the same Apple ID will appear on Find My iPhone feather, lcick on the iPhone you want to reset the password, then click on Erase to erase all settings and data on iPhone. Then you can reset iPhone passcode. but you should know the iPhone apple ID and password.
Force factory reset:
1: Connect iPhone to computer, and launch iTunes or finder then.
2: Press and release on volume up button, then press and release volume down button, press and hold on power button, when iPhone screen goes to black, press and hold on volume down button.
3: After 5 seconds, release power button but still press and hold on volume down button. Release volume down button when connect to iTunes logo appears on iPhone .
You should enter Apple ID and password to bypass the activation lock also. Then reset iPhone password.