When an earthquake occurs, it makes seismic waves, which cause the shaking we feel. Seismic waves are essentially just the jiggling of the ground in response to the force put on the ground by the earthquake, similar to the way the jello in a bowl responds to a tap to the side of the bowl. There are three major kinds of seismic waves: P, S, and surface waves. P and S waves together are sometimes called body waves because they can travel through the body of the earth, and are not trapped near the surface.
A P wave is a sound wave traveling through rock. In a P wave, the rock particles are alternately squished together and pulled apart (called compressions and dilatations), so P waves are also called compressional waves. These waves can travel through solids, liquids, and gases. P waves can travel through the liquid outer core.
An S wave is a different beast. In an S wave, the rock particles slide past one another, undergoing shear -- so an S wave is also called a shear wave. You can make shear waves by, for example, tying a rope to a tree and shaking the free end of the rope up and down or side-to-side. The waves themselves will travel forward, toward the tree. But the rope particles will stay in one place, sliding back and forth past each other. Shear waves cannot travel in liquids or gases -- so, for example, S waves don't travel through the ocean or through the outer core.
Surface waves are called surface waves because they are trapped near the Earth's surface, rather than traveling through the ``body'' of the earth like P and S waves. There are two major kinds of surface waves: Love waves, which are shear waves trapped near the surface, and Rayleigh waves, which have rock particle motions that are very similar to the motions of water particles in ocean waves.
The images on this page come from the UPSeis program at Michigan Technological University.