How can I prepare this old exterior wall for painting?
The first step would be to strip off as much of the old paint as possible.  The best way I've found to do this on stucco or concrete is to use a wire brush bit in an electric drill.  

Second (and most important), it looks like you have some areas with significant cracks in them, so you'll also want to repair or fill the cracks in order to prevent them from allowing moisture into the stucco. This appears to have been the main contributor to paint failing in the past - note how all of the areas of peeling paint run along the cracks. When the stucco is allowed to absorb moisture, it gradually destroys its bond with the primer. 

Finally, use a high quality masonry and stucco primer to ensure a well bonded base coat.