The elements are state law, and they are not a single national list. What a claimant must show, and for how long, is set by each state's own statutes and its courts, so a general rule stated with confidence is almost always someone's local rule presented as everyone's. Two named states make the range visible.
In California, Code of Civil Procedure section 325 requires that "the land has been occupied and claimed for the period of five years continuously", and that the claimant and their predecessors "have timely paid all state, county, or municipal taxes that have been levied and assessed upon the land for the period of five years during which the land has been occupied and claimed". The statute adds that payment "shall be established by certified records of the county tax collector", so the tax element is proved from the collector's own records rather than by the claimant's receipts. Where the claim is not founded on a written instrument, judgment or decree, section 325(a) counts land as possessed only where "it has been protected by a substantial enclosure" or "has been usually cultivated or improved".
In Florida, the period is longer and the tax requirement is structured differently. Section 95.12 of the Florida statutes bars an action to recover real property unless the claimant was "seized or possessed of the property within 7 years before the commencement of the action". Where the occupier holds under no written instrument, section 95.18 requires that they paid all outstanding taxes and matured installments of special improvement liens "within 1 year after entering into possession", filed a return describing the property with the county property appraiser "within 30 days after" doing so, and paid the taxes for the remaining years. The return form itself must carry a notice in at least 12-point boldface type reading "THIS RETURN DOES NOT CREATE ANY INTEREST ENFORCEABLE BY LAW IN THE DESCRIBED PROPERTY", which is the legislature telling anyone who files one that paperwork is not a claim.
Color of title is the split that runs through both codes. Each treats two situations separately. In the first, the occupier entered under a written instrument, judgment or decree that appeared to convey the property and turned out not to, which is the classic case of a defective deed or a description that covered more land than the seller owned. In the second, the occupier had no document at all. Florida's two sections show what the difference is worth: section 95.16 lets an occupier under color of title hold "the property included in the instrument, decree, or judgment" rather than only the part actually used, while section 95.18 attaches the tax-payment and property-appraiser filing conditions to the occupier who has no instrument at all. Section 95.16 adds its own condition, that for possession commencing after the end of 1945 the instrument relied on must have been recorded.
Permission defeats the whole thing. Possession that the owner allowed is not adverse, which is why a tenant who stays after a lease ends, a relative living in a family house, or a neighbor using a driveway with the owner's blessing are not on the path to ownership however long it goes on. Those situations are governed by landlord-tenant law and by the eviction process, and the colloquial phrase "squatter's rights" is used loosely for all of them, which is the main reason the doctrine is misunderstood. A person occupying a house without the owner's consent is far more likely to be removed through the ordinary process for recovering possession than to acquire anything.
A closely related doctrine covers use rather than ownership. Where someone uses part of a neighbor's land for a long period without permission, the result may be an easement acquired by that use rather than title to the land. The difference is what is acquired: a right to keep doing something, as against ownership of the ground itself.