The water content of a piece of wood can be measured with the use of an instrument called a hygrostat. It has two sharp probes which penetrate the wood and measure the electrical resistance between the two probes. This is translated into % of saturation of the wood. 100% would be dripping wet through and through. The building code calls for framing lumber to be 19% or less moisture content, primarily because at 20%, fungus cells can reproduce in the wood. A secondary reason for wanting to build with dry lumber is what we call drywall nail pooping.
If drywall is nailed tightly to a wet piece of wood, something is going to happen when that wood dries out. A 2x6 at 25% moisture content, all too common in construction, will shrink over 1/8th of an inch by the time it stabilises at somewhere under 19% many months later inside that warm protected wall. Some people think that nail popping is caused by the nails coming loose, so they use longer than standard nails. Error. Those long nails will embed deep inside the stud and prevent the nail from moving with the shrinking surface, effectively forcing the wood to shrink back along the shank of the long nail leaving the entire 1/8th of an inch as a gap between the stud and the wall. If you use nails just long enough to do the job, 1-1/4inch long for 1/2 inch drywall, the nail will travel a bit with the shrinkage and leave less of a gap. If you use 1-1/4inch screws, the threads will not allow the wood to shrink back along the shank and the screw will tend to follow the wood, leaving very little gap between the drywall and the newly dried stud. Of course none of this shows until someone pushes against that wall, and the nail head pops forward.
If you build with wood below the 19% moisture content level to start with, you won't have this problem with any of the fasteners.
What effect does rain have on all of this during construction? Not nearly so much as we tend to think. It takes a long time for moisture to move from the centre of a wet stud to the surface, it also takes a long time for water to travel into the core. Several days of rain will only wet the outer fraction of an inch, which will dry out just as quickly once the roof is on. So if you start with dry wood, some rain won't hurt. If however the wood was kiln dried at the factory, and then spent four months out in the rain at the lumber yard with no protection, that could eliminate the advantage of drying the wood in the first place. If you're building with green lumber, you're asking for trouble. Generally speaking, rain does much more damage to plywood floors than to stud walls.