Simply put adverse possession is the legal concept in which one who occupies land without permission for long enough becomes the owner.
This is the squatter's holy grail.
In California the time period is five years which is the shortest of any place I've heard of. Of course in California you must pay the property taxes during that period as well to claim uncontestable ownership of a piece of land.
Now that may sound straight forward, but in real life it is much more complicated. For example, if the owner sues you within the first five years you're pretty much screwed. Also, if it's been over five years and you didn't pay the full five years taxes then you're screwed. Even if you paid five years of taxes if the years you paid do not correspond with the five years you squatted the property you are also screwed.
Also, if you ever have permission from the owner you cannot count your permissive occupancy to count towards the five year requirement. If you leave the squat and come back this also may start the clock over, especially if you have to break back in because the owner boarded up the house or changed the locks.
Because of the difficulty of fulfilling all of these requirements very few squatters achieve ownership through adverse possession. Even if you do achieve it there is no guarantee that the courts will follow the law and grant you the rights you deserve. Judges will often ignore the law because of their class bias against squatters. I'm sure you've heard the story of the guy who was convicted of assaulting a police officer's fist with his face. It happens all the time.
A more reasonable goal is to find a place and live in it for as long as possible. A good situation is when the police and city don't get involved and the neighbors don't mind. Another good situation is if you meet the owner and they don't mind you being there, or even... imagine this... like you.
These outcomes are good even if they fall short of adverse possession's requirements. You have a place to stay rent free for a while, and maybe when they finally try to evict you they might even pay your moving expenses to avoid a trial.
Oh, and just because you can't claim ownership through adverse possession that doesn't mean you don't have other rights and options to fight for your squat. You do, but I'll talk more on that later.
Also, if you really want to adversely possess a property it's not impossible. It's just tricky, and I'll explain more on that later too.
What is Adverse Possession?