Two conventions, borrowed from finance
There is no single method every lease uses. Landlords and property managers pick one of a small set of day-count conventions, the same choice bond and loan markets make when accruing interest for a period shorter than a full term. The "banker's month" convention treats every month as exactly 30 days, no matter how many days it actually has. This is the same 30/360 day-count convention the International Swaps and Derivatives Association formally defines in its 2006 ISDA Definitions for interest accrual, applied here to rent instead of a bond coupon. The "actual days" convention instead divides by the real number of days in that specific calendar month, so the daily rate is higher in February and lower in a 31-day month like January, March, May, July, August, October, or December.
A third option, sometimes called the "annual" or "365" method, skips the month entirely: it multiplies the monthly rent by 12 to get an annual figure, then divides by 365 (or 366 in a leap year) to get a daily rate that stays constant all year. All three agree exactly whenever the partial month itself has 30 days (April, June, September, and November) and diverge everywhere else. That is the reason a lease needs to say which method applies instead of just saying "prorated."
Worked example: moving in on March 20
A tenant with a $1,500/month lease moves in on March 20. March has 31 days, so the tenant occupies the 20th through the 31st: 12 days. Under "actual days," the daily rate is $1,500 ÷ 31 = $48.387..., so 12 days comes to $580.65. Under "banker's month," the daily rate is a flat $1,500 ÷ 30 = $50.00, so the same 12 days comes to $600.00 instead. That is $19.35 more, because 30/360 always understates a 31-day month's real length by one day's worth of rent. Under "annual (365)," the daily rate is $1,500 × 12 ÷ 365 = $49.315..., landing at $591.78, between the other two.
The move-in day itself counts as an occupied day in all three methods here (the tenant has the unit from the 20th onward), which is the more common convention. Some leases instead start the clock at midnight after move-in, which would shift every total by exactly one day's rent.
Moving out works the same way, counted from the 1st
For a move-out instead of a move-in, the occupied days run from the 1st of the month through the move-out date, inclusive. A $1,800/month tenant who moves out on September 10 (a 30-day month) occupies 10 days: $1,800 ÷ 30 × 10 = $600.00 under either "actual days" or "banker's month," since September happens to have exactly 30 days. The two methods only disagree in months that are not 30 days long. Under "annual (365)," the same 10 days comes to $1,800 × 12 ÷ 365 × 10 = $591.78.