I suppose you mean, does the submarine float. This is the buoyancy equation which is the volume of the object times the density of the water (the weight of water that is displaced) minus the weight of the object.
If the answer is zero, the object is neutrally buoyant and will tend to stay in place. If it is positive the object will rise to the surface and if the answer is negative the object will sink.
Real objects tend to be compressible and so if they are pushed down the pressure from the weight of the water above the object will reduce the volume of the object and reduce the buoyancy so the object continues to sink.
Likewise if an object rises, the pressure from the water at lower depths decreases, allowing the object to expand and displace more water, so the buoyancy increases and the object continues to rise.
If one looks at fish, they mostly have a "swim bladder" which is a small air filled chamber, that they can squeeze harder than the outside water pressure. They compress it and lower the volume when they want to go down and relax it and let it expand when they want to rise. Full size submarines use a similar method with air ballast tanks to ensure they can rise to the surface by displacing water with pressurized air or releasing air so they sink.