Sorry, but only the previous owner can deactivate the activation lock, check this article:
It sounds like the phone has Find My iPhone/Activation Lock enabled. You'll need to reach out to your friend (assuming he/she was the previous owner) and have them remove the phone from Find My iPhone before you can sign in with your own Apple ID.
There are comprehensive steps in this article for you to provide to the previous owner - Turn off Find My iPhone Activation Lock
Any time you purchase or obtain an iPhone, it is important to know or have contact with the original owner in case they forgot to turn off Find My iPhone.
If the previous owner is not your friend and/or you have no method of reaching that person, the phone will remain locked and you will not be able to use it with your Apple ID. This is a security feature, so neither Apple Support or the Apple Store will be able to assist.
Unfortunately, if your friend has no way of regaining access to his Apple ID, the phone will remain Activation Locked indefinitely. I know this information isn't helpful, but it's the reality of the situation.
If your friend has an original proof of purchase from when the phone was first bought (i.e. from the cell phone carrier, Apple Store, or other retailer), Apple Support may be able to help him explore additional options, but there is no guarantee.
Question: so i have this phone that i got from my friend and when i try setting it up it doesnt work i cant use my account to unlock the iphone it says i have to use the original owners icloud but i try the original one it says that the account is locked