Method 1 - How to Reset iPhone Password
The official method to reset the iPhone password is to perform a restore. However, a normal restore (learn how to restore an iPhone) won't work as your password will prevent it. So here is a workaround suggested by ADAM DACHIS from Lifehacker:
1. To be sure your information is safe, you need to check if your iPhone have an integrated backup on computer or iCloud.
2. Switch your iPhone into DFU mode. To do so, reboot your iPhone by holding down the power and home buttons simultaneously for about 10 seconds. When you see the Apple logo, let go of the power button but continue holding down the home button. Soon you will see an image displaying a USB cable, the iTunes icon, and a message that says "Connect to iTunes."

Connect Your iPhone to iTunes
3. Assuming you still have your iPhone connected to your computer with iTunes open, you'll also see a message telling you iTunes has detected an iPhone in recovery mode and needs to restore. Now you can click the Restore button in iTunes and then wait for iOS to download and install on your iPhone.
4. Restore your iPhone with iTunes and the iPhone password will be removed.
Method 2 - How to Reset iPhone Password with iFunbox
Download and open iFunbox > Connect your iPhone (jailbreaking) to computer > Find and expand Raw File System > Go into /var/keychains and delete "keychain-2.db" file > Restart your iPhone to see if the password persists.