Here’s how to do it:
Open Disk Utility (Applications > Utilities).
Select your Mac’s hard drive.
pick the Partition button.
Name your partition and click Apply.
Launch the Yosemite installer.
Just wait for the installer to run, and you’ll have Yosemite on a second system.