How to remove an apple id from a used iphone?

I bought an iPhone on eBay and when I got it it was dead. I chathese it and it was locked! I restore it on iTunes but is linked to an apple account. I can't contact him. Hoe do I remove it from the account?

Should be on settings.

You don't, the owner has to erase it so you can set it up as your own (thats why if its stolen they won't be able to erase it and start over, its a security feature but contact him as he can also erase it remotely through icloud and remove his ID… Assuming its not stolen of course.