Is there a viable way to detect urine using some gas sensor? If there is such way, what would be the maximum distance between such sensor and the "sample"?
Yes, it's possible, given a large budget. The late 1960s-era manpack and helicopter mounted people sniffers tested in the US war on Vietnam could detect ammonia in human urine and other components of human odors using air sampling and IR spectrophotometer techniques. Not very effective militarily as human detectors, as they made a characteristic noise and were easily fooled by hanging buckets of excrement in the jungle and provided false positives from animal urine or odors from the soldiers using them. Detection distances in the hundreds of meters were claimed, but that may have been for something more like a latrine ditch for a large number of soldiers than a single man ("Charlie") moving discreetly.
UV light can also be used, but it's not gas detection.
I believe it would be possible. There are somewhat sensitive low cost electrochemical ammonia sensors available that may work, but I'm not sure what the gas dispersion characteristics of the ammonia in urea would be, therefore it's difficult to say what the maximum distance is. I found one study that talked about the airborne ammonia concentrations in mouse cages approaching 25 PPM so it seems feasible to detect urine using an EC sensor with < 100PPM range. You could improve correlation using a low cost, 8x8 thermobolometer detector pointed at the area of interest to detect the temperature. Distinguishing between human and animal urine seems improbable using gas detection.