Will styrofoam insulation prevent condensation from dripping from metal roofing?
Condensation is caused by the underside of the roofing getting colder than the dew point. To prevent this, you would need to insulate the underside and achieve a perfect air seal so that no humid air can bypass the insulation and touch the cold roof. Otherwise you'll still get condensation on the underside of the roof, but it will drip onto the insulation, negating its insulating power and maybe rotting the wooden structure (ain't wood great?).

Typically spray foam is used for this, to ensure the necessary perfect air seal. Unfortunately, because your roof has no sheathing, you would need to spray foam right under your exposed roof, meaning the foam would stick to the metal panels and make future maintenance or replacement a nightmare. This will work, it's just that it will create problems for anybody who needs to replace panels in the future.

Here's an alternative if you're willing to remove the metal roof and increase the height of the roofing by a few inches:


Remove the metal roof
Install plywood as roof decking over where the roofing used to be
Install 4-6" of inexpensive foam boards above the plywood, with any foil-faced sides facing up
Install standard roofing underlayment over that
Fasten them down with 2x4 purlins
Re-install the metal roofing over the purlins
Insulate between the rafters on the inside with fiberglass or mineral wool batts