Unfortunately, there is no 100% effective method of preventing condensation. Condensation thrives when several factors come together: a humid, wet environment, temperature changes throughout the day, and moisture being released in the tent (usually by tent occupants!) We can't do much about the environment, but site selection is critical in terms of distance from vapor-producing features like rivers, oceans, and other bodies of water. A campsite near these features will allow more water vapor into the surrounding air, resulting in more condensation.
Temperature changes can cause humidity in the air (as water vapor) to condensate on tent fabrics because cooler temperatures cannot hold as much water vapor. And, believe it or not, adult humans can exhale about 1-2 pints of water during the course of a night. This warm, saturated air has to go somewhere, and often it doesn’t make it past the roof or wall of the shelter. Instead, it gathers and can drip back down on to the inhabitants. A rainstorm often brings about 100% saturation levels of water vapor in the air, and to keep tent occupants and their gear dry, the tent is normally fully closed up. This prevents air circulation inside the shelter, and all of the trapped humid air begins to interact with the slightly cooler fabric, causing it to change from a gas to a liquid and condense on the fabric.
The best way to minimize condensation is to allow as much ventilation as possible. If you do notice moisture on the inside of the shelter, feel free to wipe it away with a towel or other absorbent material. A common myth is that touching a wall or roof during a rainstorm will make liquid travel through the fabric- this is completely false and keeping the inside of the fabric dry actually allows vapor to escape more efficiently!