You need to buy a copy of XP or Windows 7 so you know you have a legal Product Key to activate it. Your friend places you in legal jeopardy if he is installing pirated software on your laptop.
If this friend told you it is not pirated, ask him to produce the packaging with Product Key on COA sticker.
According to the specs posted this is an Acer Aspire 5517 which originally came with Vista, so you can always find a Vista installer for your licensed version to clean reinstall with the Product Key on the COA sticker attached to laptop . If it still has the Acer Recovery Partition you can attempt to run Acer e-Recovery, or order the Recovery Disks from Acer. Acer Support: Frequently Asked Questions list for Recovery media and Restoring a system to factory load