Low-expansion foam is the most common way to air-seal windows, but in my experience it doesn't work as well as backer rod and caulk. The main reason is that when we air-seal, we are also sealing for water. Foam (even if it's installed carefully, which it often is not) is a closed-cell product and reportedly water-proof. But in my experience it does not remain flexible for very long, and can separate from the wood at the edges if the framing shrinks, as it often does over time as the lumber dries.
Using caulk doesn't take that much more time and is not more expensive. But it does take a little more attention. The pay-off is a seal that will last longer, and will be less likely to leak, particularly at the sill where water is most likely to back up and spill into the interior.

Below are links to the sealant and backer rod we typically use, and a few of the the rock-solid tools that have lasted for my crew better than others we've tried.



