Spent two winters chasing cold drafts along my basement ceiling before I figured out the air was coming straight through the sill plate and rim joist bays. Here's what actually worked. First, pull back any insulation and really look at the joint where the wood sits on the concrete. Almost always there's a wavy gap because the foundation top is never level. Anything under about a quarter inch gets a good bead of sealant worked in with a finger, wider gaps get backer rod pushed in first then sealed over.
The rim joist bays themselves I filled with one-part foam, but go light. That stuff expands way more than people expect and it bows the wood or oozes everywhere if you get greedy. Two thin passes beats one fat one every time.
A few things I learned the hard way. Wear gloves and old clothes, that foam does not come off. Do one bay at a time and check your work before moving on. And don't forget behind the finished walls if you have any, mice only need a gap the size of a pencil and they will find the one bay you skipped.