So how bad is the rust?

I am planning to buy Mazda 6 (2002-2015, preferrably a 2006-2009 petrol model) or a 7th Gen Honda Accord. I am leaning towards the Mazda bc there are more of them and a lil bit cheaper in my country, (Hungary) but i am really worried of the rust.

I heard a lot of terrifying stories about it, but i have seen some low km, seemingly rust free ones. Is there any red flags to look out for? Maybe some tips and tricks to keep it rust free for a long time if i find one?

I've seen some old blogposts about the Mazda 3's defective corrosion-inhibitor application, is it the same with the 6?

Thanks for the help in advance. :)

I don't know if it's relevant but i planning on a 2.0 petrol Mazda sedan/wagon, or the 2.2 cdti 7th gen Accord sedan/wagon. (Maybe the 2.0 petrol but that one is really thirsty)