Here is some basic advise on what anodes to be used where:
Magnesium has the most negative electro potential of the three and is suitable for zones where the resistivity of the electrolyte (soil or water) is higher. These are usually onshore pipelines and other covered structures, although they are also used on freshwater vessels and in water heaters. Sometimes magnesium’s negative ability can be a weakness: if the potential of the metal turns out to be excessively negative, hydrogen particles can develop on the cathode surface, causing hydrogen embrittlement or peeling of the coating.
Zinc generally has a low drive voltage, which means that it most likely cannot provide adequate protection in soils/waters with higher resistivity e.g. in freshwater. Zinc works perfectly fine in Saltwater or slightly brackish.
Aluminum anodes have advantages, for example, they are lighter and have a much higher capacity than zinc. In any case, their electrochemical properties are not considered to be as stable as zinc, and more consideration needs to be given to how they are used. Aluminum anodes are passivated when the chloride fixation is below 1,446 ppm.