I think you're husband needs to do his best, but also don't stress about this. To be honest, my husband and I certainly swear; me much more so than him. I mean, I really probably swear a lot. Much like your dh, it's not at anyone or in a demeaning or violent way. I just do it in casual conversation without thinking about it or if I drop something on my foot or something. I work in a profession where we use a lot of colloquial language with the communities we work with, so it's frankly not uncommon that I use those words in a professional context. I've been so used to not censoring myself at work for so long that it's really hard to suddenly do at home.
To be honest, my daughter is only now getting to the age at 4 when she would probably pick up on my language. Before this she was completely oblivious. But even when she has said things, it's been easy to talk about them. She's never picked up anything from me, but she did come home from school recently saying using the word 'stupid.' That is not a word we use in our house and she said she learned it from her friend. We talked about what it meant and why it might be hurtful to someone to say that and also why we shouldn't say it about ourselves either. She totally understood and it's not been an issue again. In fact, the other day I made a remark about 'oh, this stupid thing...' talking about my computer which was acting up, and she was like, 'mummy, we shouldn't say stupid, it's not nice!'
I think your husband should do his best to mind his language, but if it happens and your ds says something he shouldn't just talk about it and why he shouldn't and also why daddy shouldn't either. My dd was right that I shouldn't have said stupid when I could have thought of a nicer word. I think it's actually good for them to see you admit you make mistakes sometimes and it teaches them how to fix things they do that they shouldn't. At 2, he might be too young for these conversations, but by the time he might notice any bad language, he'll probably be old enough for you to talk to him about it.
At any rate, though my language use is not great, my daughter has yet to say anything (except for a few things she clearly picked up from school, not even words we say in our house, and not even especially bad ones) and she's about to turn 5. I suspect it has to be a lot more pervasive than just the occasional slip up for them to pick it up.