The percentage of gold/elixir that can be stolen from storages is 25% and is capped at 198k. This means that if more than 792k is being held in storages, it is subject to the cap.
The percentage of gold/elixir that can be stolen from mines/collectors is 50% and is capped only by the storage capacity of the mine/collector.
There is an additional 1k of each resource that can be stolen inside the Town Hall.
Therefore, calculated loot = (25% x stored resources, up to 198k) + (50% x amount in mines/collectors) + 1k.
This means that the maximum calculated loot, for each resource, that can be stolen from an opponent (with maxxed mines/collectors and full storages) is: 198k + (6 x 75k) + 1k= 649k.
These figures are BEFORE the multiplier is applied. The multiplier is what is behind the loot "penalty" and the loot "bonus". The amount of AVAILABLE loot= calculated loot x multiplier. The multiplier is determined as follows:
5% for attacking someone with a TH 4+ levels lower than the attackers.
25% for attacking someone with a TH 3 levels lower than the attackers.
50% for attacking someone with a TH 2 levels lower than the attackers.
100% for attacking someone with a TH 1 level above, 1 level below, or equivalent to the attackers.
125% for attacking someone with a TH 2 levels higher than the attackers.
150% for attacking someone with a TH 3+ levels higher than the attackers.
The most important implications from the multiplier data is that TH 7 attackers may win 125% of calculated loot from a TH 9 and a TH 9 attacker may win only 50% of the calculated loot from a TH 7.
Given this data, the absolute maximum loot that can be won for each resource is: [198k + (6 x 75k) + 1k] x 1.5 = 973.5k
The comprehensive formula for finding available loot is:> (multiplier percentage) x [(25% x storage amount, capped at 198k) + (50% x mine/collector amount) + 1k] = loot
Note: The 1k stored in the Town Hall is subject to any multiplier penalty but not any bonus, since 1k is its maximum storage capacity.
Dark ElixirEdit
Dark elixir storages have 5% available for raiding and dark elixir drills have 75% available for raiding.
The maximum calculated loot for dark elixir is: 5% x (200k) + 75% x (2 x 1.6k) = 12.4k
With a TH 7 attacking a TH 9, the maximum would be 125% x (12.4k) = 15.5k
The formula for dark elixir loot is: (multiplier percentage) x [(5% x storage amount) + (75% x amount in drill(s))]= loot
The maximum amount of resources you can raid are 50% of Resources stored in the Gold/Elixir Collectors, 100% of the resources stored in the Town Hall, 75% from dark elixir drills, 5% from dark elixir storage, plus 25% of Gold/Elixir Storage up to 198k.
Assuming your opponent is maxed out on everything and has full storage and collectors, this means a maximum of 649k of gold or elixir can be looted.
If you have a Town Hall which is 2 levels higher than your opponent's you will be able to loot only 50% of the maximum. The penalty increases to 25% of the maximum if you are 3 or more levels higher.
This penalty gets applied after the first calculation. That means if normally you could loot 100k from your opponent, a two town hall level difference would reduce that amount to 50k.