Reinstall mac os x 10.10 yosemite; never had mac os license assigned to my icloud account Recently I found an old MacBook, probably from 2009 at my company's storage place. My boss allowed me to take it and I really want to try it out.

The thing is, when I try to reinstall mac os with Recovery boot (command + R) I have to login into my iCloud account. After I do it, it says that the service is currently unavailable. The thing to mention is that I never had any mac os assigned to my iCloud account. I've read some forums, but I want to be sure. 

Should I buy a license for some Mac OS on apple's site and then try to login again and then it would work?

Thank you.
It may be asking you for the iCloud account that was originally used on the machine.  Try to get the iCloud account/password that was originally used on the machine, if it was a company machine, and de-register it with that iCloud account so you can register it on yours.

There may be no need to buy a license.  If the current OS is Mavericks or higher, upgrading is free.  If it is older than you should buy a license.