Technically, the lawyer has to advise the client based on the truth. So, e.g. if the client tells the lawyer that he has swindled someone, the lawyer is supposed to defend the client on all legal rights in the interest of the client based on the truth.
However, the client may also reject such advice and requests the lawyer to help fabricate a story not based on the truth. It's supposedly illegal for a lawyer to do that, but there's the lawyer-client privilege that all that's said by a client to a lawyer are confidential and inadmissible as evidence in court.
In practice, very few clients would confess to their lawyers unless the relationships are very close-knit. Most guilty accused would fabricate their own stories if they want to get off scot-free and lie to their lawyers. The lawyers would most probably know or at least suspect. They won't probe for the truth and would just take the story as the client tells it and work on it. Professionally, they're not required to find out the truth. That's the job for the police, prosecution and judiciary.
From Kevin Tan's book Marshall, it was recounted how when Marshall asked for the truth, Sunny Ang told him that as his defense lawyer, it was M's duty to teach him what to say in court and he'll say it. M blew his top.