If it is a retail version with full retail key then yes.
If it is an OEM version, then not technically.
If it is an upgrade retail version then maybe.
When your friend installed his O/S, did he wipe the HDD and clean install using his own full licence, or did he install an upgrade using your old licence as a base?
If first option, then you shuld be clear to install base on the above version criteria.
If second option, then no because he is using your licence still.