One of the lone pairs on the sulfur is conjugated with the pi bonds of the ring, so this compound has a total of 6 pi electrons in the ring (4 from the 2 pi bonds and 2 electrons from one of the lone pairs on sulfur), which follows Huckel's rule.
If you replace the sulfur with a N-H, you will have a similar situation: the lone pair on the nitrogen is involved in the aromatic ring (and consequently unavailable to abstract a proton in an acid-base reaction).
The one weird thing about this compound is that normally I would say the sulfur must be sp3 hybridized, but here, if the sulfur is sp3 hybridized (as opposed to sp2 hybridized) then the compound could not be aromatic. If this compound is aromatic, then I think the sulfur must be sp2 hybridized even though it is attached to 4 "things" and normally would be thought of as sp3 hybridized. I think there are some cases where this occurs also with nitrogen (i.e., nitrogen "should" be expected to be sp3 hybridized but in reality is sp2 hybridized). I'm not really sure about this last part, but as for why the compound in your picture is aromatic -- it's because one electron pair on sulfur is used in the ring.