This page lists the steps to unlock diving and the controls to dive underwater in Final Fantasy XIV.

When Do You Unlock Diving?
Diving is unlocked during the level 63 Stormblood Main Scenario Quest In Soroban We Trust.
How Do You Dive?
If you are swimming on the water's surface, you can dive (but not in shallow water) by pressing Ctrl+Spacebar on keyboard or by pressing B on Gamepad. If you're in shallow water, you may have to swim farther away from the shore before you can dive.
Can I Change the Commands for Diving?
You can change the default diving commands by going to Main Menu > System > Keybind, under the Movement tab, where you can change the setting for Flight/Diving - Descend.