The planetary dynamics of 4/3, 3/2, 5/2, 3/1 and 4/1 mean motion resonances is studied by using the model of the general three body problem in a rotating frame and by determining families of periodic orbits for each resonance. Both planar and spatial cases are examined. In the spatial problem, families of periodic orbits are obtained after analytical continuation of vertical critical orbits. The linear stability of orbits is also examined. Concerning initial conditions nearby stable periodic orbits, we obtain long-term planetary stability, while unstable orbits are associated with chaotic evolution that destabilizes the planetary system. Stable periodic orbits are of particular importance in planetary dynamics, since they can host real planetary systems. We found stable orbits up to 60 • of mutual planetary inclination, but in most families, the stability does not exceed 20 • -30 • , depending on the planetary mass ratio. Most of these orbits are very eccentric. Stable inclined circular orbits or orbits of low eccentricity were found in the 4/3 and 5/2 resonance, respectively.keywords Extrasolar planets, general three body problem, mean motion resonances, periodic orbits, planetary systems.