Tier 1 tower
Damage range: 100-120
Average damage: 110
Let's take a look at last hitting ranged creep under a tower first, since that's much (on average) easier to do than last hitting melee creep.
Ranged creep
300 HP
2 HP regen
0 armor = 0% reduction
If a tower hits a full HP ranged creep twice the ranged creep will have between 60-100 HP left, and on average said creep will have 80 HP left. Always hit a ranged creep once before the tower gets two hits in. If you and the tower start attacking a ranged creep at the same time, hit it once and let the tower hit it twice. Then hit the creep again to pick up the last hit. This rule of thumb stands for almost every hero, since no ranged hero has enough base damage to one-shot a full HP ranged creep and there are only a handful of melee heroes that can do so if assisted by a Quelling Blade.
So what about when ranged creep with missing health come into your tower range? First, you must consider your hero's damage. To keep things simple, we will be looking at said hero's average damage (base plus any damage-boosting starting items you may have). Call that average damage x. Note that some of what I write below may seem trivial or obvious; I'm just listing that information to be inclusive.
+ Show Spoiler [Math part] +
So if the ranged creep has between...
- 260 and 300 HP, hit the creep once if you won't bring it below 220 and let the tower hit it twice before finishing it off. If you will bring it below 220 with one hit, go to next bullet point.
- 220 and 259 HP, hit the creep once, let the tower hit it once, and then finish off the creep if you have over 55 base damage. If not, let the tower hit it twice before finishing off the creep.
- 220-x and 219 HP, hit the creep once and let the tower hit it once before finishing it off if you have over 55 base damage. If you don't, hit the creep twice before before the tower hits it once, and then last hit.
- 111 and 111+x HP, let the tower hit the creep once before finishing it off. Note: may overlap a bit with previous bullet point if x > 55.
- x+1 and 109 HP, finish off the creep by hitting it twice if you have over 55 average base damage. If you don't and the creep has close to 109 HP, you either need to hit the creep three times to kill it before the tower focuses it or let the tower shoot it once and hope that the tower damage for that shot is in the lower half of the range.
- 1 and x HP, last hit the creep before the tower can hit it.
Rule of thumb for ranged creep: Always hit once before tower hits twice when at full HP. If tower hits it twice and you can't kill it in one hit, you need to hit it once beforehand. If creep is damaged already, deal whatever the creep has in life minus 110 in damage before the tower hits it twice (let the tower hit it once).
Now for melee creep. Generally harder to last hit.
Melee creep
550 HP
HP regen .5
2 armor = 10.714% reduction = .89286 ~= 0.9 damage multiplier for simplicity
If tower hits a full HP melee creep 5 times that's 98 damage on average per hit, resulting in the creep having 60 HP left. At early levels, you can pretty much always get the last hit if you hit the creep once between 5 tower shots. In order to "on average" last hit a full HP melee creep after five tower shots, your hero needs to be able to deal 68 damage with one attack. This is doable for many melee carries with Quelling Blades, and impossible for ranged heroes (with the sole exception being Luna, but that's the very high end of her damage).
Now for melee creep missing some HP. Again, let's define your hero's average base damage as x. Let the tower hit the creep down to around 250 HP, then assess the situation.
+ Show Spoiler [Math part] +
So if the melee creep has between...
- 201 and 250 HP, let the tower hit the creep twice before last hitting it. If you don't have over 60 base damage and the creep is close to 250 HP, hit it once before letting the tower hit it twice, then finish the creep off.
- 200-0.9x and 200 HP, hit the creep once and let the tower hit it once before finishing it off if you have over 57 base damage. If you don't, hit the creep twice before before the tower hits it once, and then last hit.
- 99 and 99+0.9x HP, let the tower hit the creep once before finishing it off. Note: may overlap a bit with previous bullet point if x > 57.
- 0.9x+1 and 98 HP, finish off the creep by hitting it twice if you have over 55 average base damage. If you don't and the creep has close to 98 HP, you either need to hit the creep three times to kill it before the tower focuses it or let the tower shoot it once and hope that the tower damage for that shot is in the lower half of the range.
- 1 and 0.9x HP left, last hit the creep before the tower can hit it.
Rule of thumb for melee creep: If the creep is full or has close to full HP, hit it once and let the tower hit it five times. Then pick up the last hit. If the creep has enough HP missing so that it's not close to full HP, let the tower hit the creep down first to the hit closest to 250 HP and then assess situation. If you can bring it down to the next 100 level (for instance, from 250 -> 190) with one attack, let the tower hit it twice before last hitting. If you cannot bring it down to the next 100 level with one attack, attack it once and let the tower hit it twice before last hitting.
Siege Creep
500 HP
0 armor = 0% reduction -- actually takes 50% extra damage from tower hits due to armor type
Last hitting siege creep takes a bit of luck. Since a siege creep takes an extra 50% from tower hits, the tower is doing on average 165 damage to it, with a range of 150-180. If the siege creep is full HP, let the tower hit it three times before last hitting it. Sometimes three hits from the tower will be enough to take out the siege creep, so that's where the luck factor comes in. If you have any allied creep attacking the full HP siege creep when the tower is hitting it as well, you're pretty much guaranteed not to get the last hit.
If you have a creep wave (or parts of a creep wave) attacking the siege creep with the tower hitting it as well, your best bet is to get two attacks off and then try to use the third to last hit. Generally speaking, when you combine the creep wave hitting with your attacks, you can get the equivalent of one tower shot's worth of damage in when the tower has hit the siege creep twice.
Note that the mathematics sections are a bit hard to remember in game. Obviously, once you've played enough you develop a feel for how to last hit under a tower. Yet even professional players have trouble with this aspect of the game due to the randomness caused by damage ranges. If you want to improve upon your last hitting under tier 1 towers, take what I've written into consideration.