From what you've stated, it sounds like you are trying to update your iPhone over-the-air, but you're getting error 2. I'm happy to provide some help for this issue.
Check out the article below for help with over-the-air iOS updates:
Get help with over-the-air iOS updates - Apple Support
Thanks for using the Apple Support Communities. Cheers!