Each Apple device is linked/associated with an Apple ID of the person who did the setup.
The previous owner (your buddies) has to read -> this Apple article: What to do before you sell, give away, or trade in your iPhone, iPad, or iPod touch
What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
Then the previous owner has to remove the iPhone from his account, see this Apple article:
Check your Apple ID device list to see where you're signed in
Check your Apple ID device list to find where you're signed in - Apple Support
Then you can sign in with your own Apple ID.
See the following Apple articles:
Activation Lock for iPhone, iPad, and iPod touch
Activation Lock for iPhone, iPad, and iPod touch - Apple Support
See -> How to remove Activation Lock
How to remove Activation Lock – Apple Support (UK)