Generally Comps are based on "Theo" short for Theoretical Loss/Win. The "Theo" is derived by average bet (x=times or multiplied by), x number of decisions per hour, x hours played, x "House Advantage. Different places use different Numbers but generally the formula for "Theoretical Win" is the same. For example: If you play Twenty One and your average bet is $100 and you played for 4 hours hours you could calculate your "Theo" like this;
Average Bet $100 x HPH (Hands per hour) (Generally 60) = "Handle" of $6000 x 4 Hours Played = Total Handle of $24000 x H/A (House Advantage) say 1% = $240---->That's the "THEO" or what the Casino THEORETICALLY expects you to lose. Then they will comp back a certain percentage of your theo...say 20 to 40%. If your a big loser they will take that into consideration and comp you a percentage of that but not stray too far from the "THEO".
There are different rules for "Whales". They can cut "special" deals with Hosts and negotiate discounts and air fare.
As a rule of thumb you can figure you will lose one average bet per hour and the casino will comp you back 20 to 40% (depending on what casino you play in some are tight and some are loose).
Also if you gamble and dont qualify for a full room comp you can always ask for the "Casino Rate" and get a reduced room rate.
Additionally if you cultivate relationships with the pit crew and are nice to them you can sweet talk them into a higher average bet than you normally might get.
If you are strictly a sports player, generally, you must be a limit player in order to be considered for comps. The house advantage in sports much slimmer than in slots and table games.
Max Rubin wrote a great book about this a few years ago called "COMP CITY".