Your friend 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, iPad, or iPod touch - Apple Support
Then 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 see where you're signed in - Apple Support
You can also contact Apple support for help, -> Get Support (apple.com)
You have to show proof of ownership of your product, provide all documentation showing your purchase of the device.
If you do not have additional proof of ownership, contact the reseller. They may be able to provide the original purchase document.
Once Apple receive your proof of ownership, Apple will further review your request and provide an update.
Click here for more support and assistance.