Well my question is same as the title.
what is the difference between getting a Licensed Windows and buying a Key for Windows?
they both are legal right?
Windows XP and 7 are the targets.
I am not a lawyer and this is not legal advice. This is simply my understanding of how this works within United States jurisdiction.
When you purchase "Microsoft Windows" or most other software, what you are actually purchasing is a license to use that software under the terms of its EULA. The software license you purchase permits you to use the software on one machine at a time. This is very similar to what you're buying when you purchase music or books; all of these are copyrighted works that the distributor is granting you a license to use with certain restrictions. Books and music usually come with the message "All rights reserved" and software usually comes with a EULA; essentially these permit you to use the work but not distribute additional copies of it.
In the interest of forcing consumers to follow this licensing policy, many software vendors make use of "product keys". Restrictions are built into the software that prevent its functioning unless you enter the product key. The vendor provides you with a product key when you purchase your license to use the software. Product keys are not a legal concept; they are a method of enforcing the terms of the license you purchased.
Some retail software doesn't make use of product keys, but this simply means the publisher hasn't chosen to enforce their EULA in this manner. You are still bound by the EULA even if the software isn't checking up on you.
So, to answer your question: Getting a licensed copy of Windows is the legal concept of purchasing the right to use the software, whereas the product key is the 25-character code meant to prove that you've done so.
In order to legally use Windows, your PC has to have a valid key. The media itself is largely irrelevant!
So, it doesn't matter whether you buy a copy of Windows in a box or buy a downloadable version from http://www.MicrosoftStore.com - so long as you register Windows with a valid key, you should be good to go.