I am a sub-letter in California with no formal lease with the land lord or tenant who is on the lease. The tenant asked that if I decide to move out that I give him 2 months notice. I've heard that the usual amount is 30 days with a year lease.

There was no agreement that I stay for a certain time, i.e. 6 months or one year. I'm wondering because I want to leave this place ASAP. I've informed the tenant about a month ago.
NO! With just a verbal month to month lease you only have to give 30 days notice. With nothing written, they cannot hold you to any more than that.

I hope your 30 day notice was in writing. If they refuse to give your deposit back for lack of their asked 60 day notice, then sue them for it.
30 DAYS
and stay for the exit walk through so that your primary tenant has
no gripes with you.

By the way, the 30 day notice is not for the LL; it is for
the main tenant under whom you are leasing. I presume that
you did give the main tenant a deposit of some type–or maybe
even 2.

I also presume the apt -condo bldg Ll does not even know you are there.
Well, as it stands, it is only your word against the tenants word. There is nothing in writing. I think you are free to go legally but I would recommend paying any money you might owe for utilities, rent, etc before you leave. You might as well leave on good terms and not piss them off anymore than you might by leaving early.
if you have no contract leave
Legally… if there is no written lease….. you have no obligation to stay….