You don’t mention the country. In Germany, third party liability for car insurance covers the driver, not the owner of the car or the person paying the insurance. So a German car insurance would pay Cs damage as long as the damage wasn’t done intentionally and as long as the car is insured (and when your car stops being insured police will give you a visit to make sure it is not used). A knowing that B has no license doesn't change that. Third party liability is there to protect victims, so it is very difficult for an insurance to get out of paying. (AFAIK they will often pay even if they legally wouldn't have to, as a public service that adds 10 pennies to your insurance premium because it is rare).
Of course the insurance will try to recover money from B or A if they can. If B had no license they will try to get their money back from B, similar if he was drunk. If A knew that B had no valid license, the insurance will try to get their money back from A as well.
Now if there was no insurance for the car, then no insurance will pay C, so C would have to sue A or B. Renting out an uninsured car would definitely be a reason to go after A. And A would be in trouble, plus B would be in trouble if he knew (in legal trouble beyond having to pay).
If no insurance pays, C could sue A in addition to B in a situation where A knew or should have known that renting out a car to B would put people at risk. For example if A knows that police took Bs car to stop him from driving drunk, as an extreme case. Or if the car was not insured.