How do ants sense imminent rainfall?
This article claims that ants do sense approaching rain and modify their activities in preparation. The claim is not sourced. This weather site also speaks of ant mound-building before a rain but frankly places it in the "some folks say" category. The AntBlog is associated with AntWeb, a large multi-university-affiliated database. The author of the linked blog states that ants can sense humidity with their antennae, which strikes me as a plausible means of anticipating rain. 

That ants might sense changes in barometric pressure is an intriguing idea but has not to my knowledge been demonstrated. 

A 2010 article in Journal of Neurophysiology reports an almost unbelievable sensitivity to temperature in ant antennae, allowing them in principle to sense minute temperature changes ($0.005^o$C) over a wide range of temperatures and over 0.2 second time intervals (5Hz). This is said to assist them in orientation in their microenvironment but I think it goes a long way to accounting for an ability to detect looming weather fronts. Humans can sometimes 'smell' rain and we can detect gross temperature changes that almost always accompany rain, but to be able to detect humidity and micro-scale temperature changes would give the ants a real advantage in forecasting. After all, not all rainstorms are preceded by a dramatic drop in temperature but probably the majority are preceded by minute step-wise drops in temperature that evidently the ants can sense.  

So while I think the building activity may be anecdotal (and probably true for some species) the ability to sense humidity changes and micro-scale temperature changes accounts for their ability to sense rain ahead of time. 

Ants are very well-studied and it's hard to rule out that one has missed something. There are a few "ask the expert" questions on this topic online and no one seemed sure.