Usign iMac as a Display for MacBook Pro I did some research on this and they were saying Press Command+F2
So did I !  But here are the issues I saw with this method:

The youtube video that was previously running on iMac continued to run, I could hear its vocie but no picture. I want iMac programs to stop running if possible.

The Mouse and Keyboard on the iMac stopped working and I had to use MacBook's Mouse and keyborad which is ridiculous!

What I want to achieve:


iMac turn into Display for MacBook Pro.
Be able to use iMac mouse and Keyboard.


What I have:


Thunderbolt Cable to connect to MacBook and iMac
iMac model: These new thin 27" ones.
Macbook model: 15" retinal display ones.


Basically when I am at home and want to work on my work laptop- which is this MacBookPro one - I want to be able to connect it to my iMac and use that as display.
Ok got it working:


turn off both devices.
connect them with thunderbolt cable
turn on MacBookPro AND keep holding the "T" key on its keyboard. You will see it will go to a disk mode with some thunderbolt icon showing on its screen.
Turn on your iMac AND keep holding the OPTION key on its keyboard. You will see it will show you some hard disks on the display. Pick the one that is for the MacBookPro.
Done! Now Nothing from iMac is running in the background, iMac's peripherals are working for MacBookPro AND EVEN better: you are using CPU Power and RAM of your iMac to run MacBookPro. 


NOTE: to turn off, don't just unplug the thunderbolt cable, first shut down the computer, then unplug the cable.