Building settlements in Seafarer
If you are on land, you can build settlements separated by (at least) two roads.

If you want to go to another island, you should build a "road of" boats from a settlement. Until you reach land where you can build a settlement. From the settlement you can build roads again.

You can build boats along the coast as long as they start at a settlement.

You can not alternate between roads and boats without a settlement in between.

There is one exception. If you have two settlements and you build a road from one and a boat-road from the other, they can connect. 

To summarize, 

you can build a boat on an edge if:


nothing has been built on that edge
you have at least one boat in your stock
you pay a the build cost:


a sheep and a wood
or a card that enables you to build a ship

at least one of the hexes is a water hex
either one of the nodes has a valid connector:


the node contains one of your settlements
the node contains one of your cities.
one of the other edges leading to the node contains one of your boats.
the node does not contain an enemy settlement
the node does not contain an enemy city



you can build a road on an edge if:


nothing has been built on that edge
you have at least one road in your stock
you pay a the build cost:


a wood and a clay 
or a card that enables you to build a road

at least one of the hexes is a land hex
either one of the nodes has a valid connector:


the node contains one of your settlements
the node contains one of your cities.
one of the other edges leading to the node contains one of your roads.
the node does not contain an enemy settlement
the node does not contain an enemy city