Before the person gave you the MacBook Pro they should have prepared it correctly for you.
This would have removed their identity from the mac, iTunes and their AppleID then they should
erase the mac but install the original OS that came with the mac and left it so it was ready to be set up.
Here are the instructions they should have followed,
What to do before you sell, give away or trade in your Mac – Apple Support (UK)
Are you still in touch with the person that gave you this mac.
At the moment you could try the procedures in this document,
How to reinstall macOS – Apple Support (UK)
follow the instructions for Intel macs.
If you cannot do any of the above then you may have to source another mac that is capable
of running Mac OS X Yosemite 10.10. Download the Mac OS X Yosemite installer disk image,
process that and create a bootable USB installer which you can then use to install Yosemite
on your MacBook Pro. I can give you full instructions on how to do this if you need them.