Turbofans are the best at taking in a large volume of water. Almost all of it stays in the bypass stream, as it's deflected away from and around the core's inlet. Most turbofans are designed to Part 121 requirements, calling for reliable operation at 20 g/m^3 of water, well beyond typical rain conditions.
As an example, when an A380 had its engine control wires cut, it took 2 hours for the fire crews to drown the engine (page 9 on paper, 19 pdf). Of course, a dip in water would've done that easily, but it's next to impossible to get that much rain.
20 g/m^3 is about the equivalent of delivering about 300 gpm (20L/s) of water into a large jet engine's airflow. That's two fire lines, but not all of the water gets in. This is the amount where the engine is certified to work, drowning it takes more.
A related question goes into more detail: How does a jet engine handle suddenly entering a lot of rain?
Turboprops also deflect the flow of water in flight around the spinner. Some rely on inertial separators, used at takeoff, landing, and in the clouds, for better protection. Turbojets don't have that feature, but haven't experienced a lot of flameouts in practice.
Piston engines also avoid taking in water by having their intake face forward or below rather than above. They're no different from road cars, which also run fine in the rain.
But that applies to ordinary rain that falls on the ground. Conditions in low-altitude clouds, especially on the edge of freezing, can be considerably worse. Reliable operation of piston engines in such is not certain and not recommended.