I am very sorry to hear this; do to rising rental costs this is becoming more common and unfortunately most people that try to do a friend a favor does not realize they may be inadvertently creating a tenancy.
CA law will find a tenancy if a party resides in a residence and is allowed to use that residence as an average person uses their residence-ie they keep their belongings there, accept mail there, invite guests, etc.
In such cases the court will impose a tenancy (implied) that is typically deemed a month to month tenancy; for such tenancies that last under 1 year in duration the landlord would need to provide a 30 day notice to vacate and if they fail to vacate then proceed with an unlawful detainer action.
The "landlord" may not use "self help eviction" by locking out the tenants without exposing oneself to liability (ie housing costs for the 30 day notice period, and even for the time period for which a normal eviction requires).
If the parties do need to pursue an unlawful detainer action the landlord may request attorney fees and costs.
Some people will pay "cash for keys" provided the party signs a release and vacates by a certain date but that is difficult to do after providing a favor.
I am sorry that I do not have better news but most states, especially CA, tend to have laws that favor the tenant. Tenant laws apply to most situations except for those listed here: