You can't dock when enemy still firing at your ship.
You need to wait 30 second after last hit before you can dock.
In test once i saw 18 Spanish ship versus 9 French ships so it's not limited to 5 ship.
Also you might want to add tips on how to kill other pirate using broadside.
When we got killed during battle we don't go to jail but respawn on the ship
and invincible to any attack for 10 seconds.
We are also invincible for 10 seconds after sinking (30 second invincibility for ship)
Captain of the ship can't teleport anywhere but crewmates on board can.