OP there's a sonar equation, analogous to the radar equation.
You have a source level SL
This is the intensity of the acoustic energy from your transmitting hydrophone. Say you send out a pulse and wait for a pulse to come back, the sent pulse intensity level is your SL.
A target strength, TS which is the intensity of the acoustic energy that is projected by any object you might see with a submarine's detectors. In active sonar, this is how much intensity of the signal hitting the target gets reflected back, like the energy a submarine would send back at you. In the passive sonar, this is basically how high the intensity of the sound that the target is making. Say a whale swims by and makes a noise and you're listening for it, the intensity of the noise the whale makes is the TS.
A transmission loss, TL, this is how much intensity is lost of an acoustic wave as it travels over a distance, so as the distance gets larger, TL gets larger. TL is dependent on spreading loss, and more complicated mechanisms like sulfate relaxation and shear stresses in the water that the acoustic signal is dissipated as heat.
A noise level NL, and other factors such as reverberation. This is a noise floor that any detectable sound needs to be stronger than, or else it will get lost in the noise. This can come from wind on the sea surface, marine life, ships in the distance, turbulence and machines in your submarine, etc.
Then there is a detection threshold that is dependent on all of the above factors.
DT = SL + TS - 2TL - NL
In the case of a passive sonar, the SL is not present and it is TL instead of 2TL because the sound only travels 1 way instead of roundtrip. So if a submarine reflects a noise with an intensity louder than 2TL + NL - SL -DT, it will show up as a waveform on the submarine's sonar. Different objects make different waveforms, and so classification of the waveforms is necessary to determine what kind of object your sonar detected. A submarine will reflect a lot more energy than a fish, so you can see the strength of the reflection and determine what the size of the object was.
As far as your other question, there are some hints.
The sea floor distance is already known, or atleast it is not changing so that you can determine it pretty fast. The time delay from when you send the pulse til you receive from the sea floor is basically a known, and if you get a reflection with a different time delay, you will know it came from somewhere else other than the floor.
Also, the frequency at which the pulses are sent determines the wavelength of the acoustic wave. A very high frequency is needed to detect smaller objects, and so an appropriate frequency is chosen to find objects of a certain size. Think of this as tuning your sensor's frequency to pick out the size of a submarine best.There are different sensors, single-beam, split-beam, multi-beam hydrophones. Split beam uses an array of transducers with 2 beams on different axes that let the hydrophone determine the direction that the object came from. More complicated beams are available that even allow imaging with acoustics. The hydrophone array allows you to steer your beam and focus it at certain places, so it is easier to guess what you're looking at if you know where the sound is coming from.