It is said that there are two kinds of houses....Those that have carpenter ants and those that will have carpenter ants.....
I find that sprays don't work with carpenter ants becasue you never get the nest. Baits work much better but take a longer time to work. HD sells Combat gel which is what I prefer. You need to do some sleuthing and identify the ant trails and put the bait along them. If you're good you can follow the trails back to the nest and then maybe use a spray on the nest but you usually still don't get the queen. Baits will get the queen.
Once you get them out of your house than use a spray to spray a 3ft perimeter around the outside of your house. This will keep them out. I prefer diazinon as a spray but since you can't buy it anymore, I prefer anything that doesn't use permithin or its relatives. THey are just too short lived and you end up spraying once a month. IF you can find where they are entering the house than just spray a 10 ft by 3 ft strip in front of that point. My ants seem to be creatures of habit and year after year they enter thru the same point. Makes it kind of easy.
I prefer to not use insecticides inside the house but if you were forced to, I would use permithin because of its relatively low toxicity and short life span.