What to paint a rusting metal roof with
First: yes you need to remove  all the rust before repainting, or the paint will just flake off as the rust continues.

Next: you need to make sure that there's some "body" left after initial sanding/scraping of rust, or you might as well replace the sheets.  You also need to verify that all rust is on the top, i.e. there's no leaking and bottom-side rust (or you'll need to fix the leaks).

Assuming all that went "ok,"  then sand &amp; scrape all the loose rust off, and do your best to sand off the rest.  Paint all exposed areas (with rust pits or not) with a "rust reducer" paint, available at any hardware store.  Typically these go on white and cure black; they both reverse the oxidation (rust turned back into iron) and provide a good surface for painting.   Then put down whatever color of metal-compatible paint you want.