After a successful landing, you can open the landing analysis screen, which will show a lot of information about your performance.
Let's start with what's needed for a perfect landing:
Assuming that no other limit has been exceeded, not meeting one of the above criteria will result in a good landing grade, not meeting two or more will show a safe landing.
If you only slightly exceed limits like the vertical speed at touchdown, or the slapdown pitch-rate, your landing will be filed as hard landing in the statistics (the Orbiter might be damaged, but the crew is safe). Anything else (exceeding the ground-speed limit, blowing a tire, missing the runway, exceeding the airspeed or g-force limits during flight, etc.) will result in either a crash or a crash landing.
You may touch down anywhere on the runway for a safe or even good landing, but for a perfect landing you'll need to touch down withing the nominal touchdown zone:
The image shows the location of the touchdown zone (marked by a red rectangle) relative to the runway markings at KSC (left), Edwards (center) and relative to the runway lights on a night approach (right).
Note that at the shuttle landing facility at the KSC the touchdown zone is marked by two large black rectanges. On a night approach, the last set of lights is at the center of the touchdown zone.
Turning on the approach corridor in the settings menu will also highlight the touchdown zone.
All variables (touchdown position, vertical speed, approach precision, etc.) are taken into account. As long as you don't crash, you should get a score.
There's a bonus for safe, good and perfect landings, so typical scores are:
Achieving a perfect landing is very hard and you'll need a lot a practice and patience. Be sure to read the Landing Tutorial and watch the autoland-demo a few times (both are accessible from the help-screen), the auto-pilot usually performs quite well.
Here are some more tips:
The score is computed at nose-gear touchdown and won't change later, so you don't have to wait until wheels stop to see your landing score.
Happy landings!