You have to separate the European Union from a geographical view.
Within the geographical EU you have the finance EU, the Schengen area (covers 26 countries). If you are in the rules are pretty much the „same“. You can stay 90 days even if you are leaving the Schengen room for some time. If you are hitting UK you are allowed to stay 180 days in the EU (yeah call it consistent). But UK will leave the EU soon.
Just leaving the Schengen area and get back into Schengen. But you have to request a new Visa in some situations, what is some kind of easy :-).
If you are sailing from
italy to
croatia for example, you are leaving eu. CRO are pretty strict. Even if you are leaving the CRO territory for 5 miles, and be sure they will take notice, you will have to check in again. So check your charts! CRO will be a
member of the EU soon, so they have to show their strict observance of any
rule.
If you are younger then 30 or in some cases 35 you can get a 1 or 2 years working holiday visa. You don‘t need to
work :-)
Even if staying longer then your visa will allow and this is not well controlled for example in
italy, don‘t! If they check, for example in italy or
spain, you could be punished extremly hard ($$$$). Also in the northern states where punishments are ajar to your financial assets. It is rare but ........
France offers long term EU visas easily. Check out the nearest french embassy or online. Think this will be the easiest way. Relatives (US) of mine got a 5 months visa but could get a longer if they wanted to. But!! You have to get intonthe EU via France. Easily if you are sailing :-).
Welcome to the Europen Union where everything is samsame *LOL*