VLF is commonly used, while most radio frequencies are foiled by seawater, VLF are able to penetrate nearly 20 meters of seawater, this still means they need to come relatively near the surface, but they don't need to expose an antenna above water either, they can stay submerged and communicate.
HOWEVER, and this is important, VLF arrays are too big for submarines themselves, typically several square kilometers, thus submarines only have VLF receiver antenna.
Because of their narrow bandwidth, VLF also can't carry audio messages, and they transmit very slowly: VLF data transmission rates are around 300 bit/s - or about 35 8-bit ASCII characters per second (or the equivalent of a sentence every two seconds) - a total of 450 words per minute.
ELF can penetrate hundreds of meters of seawater, but again, their arrays are too large. This is the Clam Lake ELF facility as part of the now-closed
Project Sanguine
You're not putting one of those on a submarine.
ELF communication works on the Reed-Solomon Error Correction that relies on transmitted code-words to be received for a coded signal to be decoded. 1/2 of the coded signals must be sent for the message to be valid. Because of their low signal-to-noise ratio, the ELF form of communication is considered very secure, if only because there aren't too many pseudo-random sequences representing actual message characters, and thus there aren't too many ways to spoof an ELF receiver.
So this is how a shore-based communicator would talk to a submarine, but how do submarines communicate with the world outside?
The current standard in the USN is the SSIXS - Submarine Satellite Information Exchange Sub-System... unfortunately details are classified so I can't really go into depth on it.
Perhaps
@SvenSvensonov can give us some non-classified details?