By squatter's rights you probably mean something known in the law as "adverse possession."
Adverse possession is the taking of title to real estate by possessing it for a certain period of time. Title means ownership of real estate. The person claiming title to real estate by adverse possession must have actual possession of it that is open, notorious, exclusive and adverse to the claims of other persons to the title. By its very nature, a claim of adverse possession is hostile to the claims of other persons. It cannot be hidden but must be open and notorious in order to put other persons on notice as to one's claim for possession of the real estate.
A claim to title by adverse possession often must be made under color of title. Color of title means a claim to title by way of a fact which, although on its face appears to support a person's claim to title, is in some way defective and falls short of actually establishing title to the real estate. An example of a claim made under color of title would be a deed whose execution was defective or is in question. Another example is a claim arising from another person's Last Will and Testament. Yet another common example is where two or more persons have received separate deeds to the same parcel of real estate.
In Alabama, the duration of such possession is ten (10) years if the claimant and/or his predecessor has a deed or other color of title recorded at least ten (10) years, has annually listed the land for ten (10) years for taxation, or, has acquired title by descent or devise from a predecessor who had title and was in possession. Twenty (20) years possession is necessary if the claimant does not possess the land under color of title.
The specific statute law setting forth these requirement is found in Alabama Code § 6-5-200 and § 6-2-8(a). You can find the Alabama Code Here.
I hope this answers your question.