I bought an IPhone 7 off a friend how do I change it out of his details and put my ones in?

I just bought an Iphone 7 32GB off my friend and I also made an account with ITunes. Anyhow I have bought the phone and a new sim card and I've tried using the phone to change it in to my details, but for some reason the whole phone seems to be still set in his name, the contacts, the text messages, his calls, all his music, pics and apps are still in his name. Anyhow I know it can be changed into my details so if anyone Here could tell me how to do it then that would be great. And also I do want to take all his details off of the phone an put mine up there, but at the same time I don't want to delete all his data that he has stored on there. So if anyone here can tell me a Way how I can log out of his data and enter mine without deleting any of his, then that would be great!

It should have been reset before it was sold to you. Do that now. I don't see why you'd want his data on there. Better thing is to clear everything off, set it up as new, & go from there.

Settings > General > Reset > Erase All Content & Settings