1) Clean all surfaces with a good cleaner, TSP will work well.
2)Now remove any peeling paint and then sand to smooth out the paint edges. Continue to sand all areas you plan on painting.
3) Vacuum and wipe down with a damp cloth to remove the sanding dust.
4) Prime with a good oil based primer, Kilz or Zinsser Cover Stain will go a good job.
Now you can paint. Apply several thin coats instead of 1-2 thick ones. This will look better and last longer.