Thermal and EM sensors are fairly straightforward. Thermal detects heat emissions, from ship engines and industry. EM detects shields, active sensors, and also industry. Basically, the bigger and more powerful the sensor, the further away it can see the same signal. You can change the power of a sensor only by researching new technology, but you can change the size just by designing it to taken up more hull space.
Active sensors are a little more complicated. You have to paint a ship with an active sensor to be able to fight it. The catch here is that resolution is involved as well. Basically, the higher the resolution of the sensor, the bigger its range... but any ship or missile under its resolution will have its detection range sharply curtailed.
To hit missiles, you have to use zero resolution, which means the active sensor range is quite short.
Is this helping so far?