Ships lie in a straight line, across or down. They cannot bend, sit diagonally or overlap, but two ships may touch side by side.
Each ship sits in one straight line along a row or a column, on consecutive cells. Diagonal and bent ships are not allowed, and no two ships can share a cell.
Touching is allowed
Two ships can sit right next to each other, side by side or end to end, with no water between them. The game only refuses a fleet where ships overlap.
Is touching a good idea?
Usually not. When ships touch, one hit tells your opponent that a second ship is close by, and a long line of hits can look like a single ship. The strategy guide covers placing a fleet that is hard to find.
Next, see whether you can move your ships once the game starts, or read the full Naval Battle rules.