First thing you can try is updating to the latest version of iTunes. Download it from here:
If that fails then you will need to try putting the iPhone in Recovery Mode.
Disconnect it from the computer.
Press and hold the power button and the volume down button together.
After about 30 seconds it will restart but don't release the buttons, keep holding them
After another 30 seconds it will show an iTunes logo and a cable, release the buttons and reconnect it to the computer.
Now open iTunes and it should offer you the option of Update or Restore. Choose restore.
Next iTunes will begin downloading the iPhone software. It could take a while.
When it finishes downloading the iPhone software, it will restore the iPhone to factory settings.
Set up the iPhone as new, do not recover from a back up.
The activation lock and passcode will be removed and you can set up your iPhone.
Let me know if any of these steps don't go as planned, I will be happy to help.
Take a moment to click the star rating, many thanks!