Before you do anything, login to the App Store and "purchase" the free Yosemite OS under your AppleID. Then just stop the download once it begins.
Now do the command-r boot to get to recovery. From there use Disk Utility to erase the disk to Mac OS Extended (Journaled). Then quit Disk Utility an click reinstall OS X. You will be asked for the AppleID and password you used to purchase Yosemite earlier.
If you skip that first step in the App Store, when asked for the AppleID during the reinstall, you would not have one with a Yosemite download attached to it, and you will be sunk.
This will get you a clean install with nothing but the OS. If you have the iLife and iWorks apps on there, they will be gone and you can't get them back without buying them unless you already own them under your AppleID.