There are two different ways that the middle pedal on American pianos works. This pedal is called the "Sostenuto" pedal and, unlike the Sustain pedal, does not sustain every note on the piano. This website gives great videos and explanations of each piano pedal.
- On higher end pianos, the middle pedal (Sostenuto pedal), sustains only those notes which are depressed on the keyboard at the time when the pedal is pushed down. Once the pedal is depressed, the notes played thereafter are not effected by the pedal.
- Lower end pianos have a similar acting Sostenuto pedal, which, however, is not a true Sostenuto pedal. On these pianos, the middle pedal, while depressed, undamps only the lowest strings on the piano.
When a composer asks the player to use the Sostenuto pedal, he or she will use any of the following:
- S.P
- Sost. Ped.
- ThP. (from German "Tonhalte-Pedal")
Some pianos, instead of using a Sostenuto pedal, provide a "Practice pedal" as the middle pedal. This pedal dampens the strings beyond the left most "Soft pedal". Often, this pedal has a locking mechanism as well.
The best way to know which type middle pedal a piano has is to test it out and see which of the above options it is.
EDIT: This website gives pictures and discussion of how some Sostenuto pedals work.
EDIT #2: This video demonstrates the sostenuto pedal mechanism.