In Florida, a "tenant" is defined in Fla. Stat. 83.43 as "any person entitled to occupy a dwelling unit under a rental agreement". Then "rental agreement" "means any written agreement, including amendments or addenda, or oral agreement for a duration of less than 1 year, providing for use and occupancy of premises".
One trigger for tenancy is giving (accepting) rent. Tenancy can also be established by a person providing something of value in exchange for the right to stay in a domicile, e.g. painting the house, picking oranges, taking care of grandma. Other signs of tenancy are receiving mail and moving furniture into the domicile. These are indicia of tenancy – the intent to reside – and not bright-line rules. If a friend comes to visit for a month, and it is clear from e.g. conversations that the intent is to stay for a month then leave, they will not have created a right of tenancy. Changing the scenario a bit, e.g. "stay until I get back on my feet" signals a different intent, and could be taken to be a rental agreement. The question of "consideration" would arise, regarding this putative contract, and the consideration would be something like "companionship and affection". There are various rulings regarding "guest to tenant" conversion, for example hotel guests can become tenants.