OP asks:
"how can i make things legit and install a valid operating system, say like Yose?"
Well, seems to me if the friend's iMac is booting and running OS 10.10.x without problems, it -IS- a "good enough" copy of Yosemite.
So far as I'm concerned, if the Mac boots and runs ok from the installed OS, then that "is all one needs"...
I'll also recommend you consider chrfr's post above:
Download and install El Capitan instead -- it seemed to me to be a more refined makeover of Yosemite. Runs quite well.
To get El Cap, try the Apple Store.
And if you can't get it there, I will suggest that there are (cough, choke!) "other places" from which it can be downloaded...