Criminal liability is based on not just a criminal act, but also having a criminal intent (or "mens rea"). For example, it's not theft to pick up  briefcase that looks just like mine, so I got them confused, though it is theft to take someone else's briefcase knowing it was not mine. If the friend will tell the police and prosecutor that he gave your boyrfiend permission to borrow the care and that your boyfriend had no reason to know that he (the friend) did not have the right to the car at that time, that will most likely help--the authorities may reduce the charges, or possibly even drop them, or at least reduce the punishment they seek.