Well this was posted at the end of November in 2015, so it's more recent.
https://forum.supercell.com/showthread.php/918490-From-the-Dev-s-Desk-Shields-Part-I-Attacking-and-Defending
Basically, 2 conditions have to be met.
1. More than 30% destroyed.
The attack has to do more than 30% damage to your base. Town Halls no longer give you a shield by themselves.
So if someone only destroyed your Town Hall, you would not receive a shield.
You also get:
A 12 hour shield at 30%
A 14 hour shield at 60%
A 16 hour shield at 90%
2. The attack must use 1/3 of the maximum full army of the Town Hall level of the attacker.
Heroes count as 25.
Ex.
If the defending player is TH7, then the max army camp level is 6, which is 50 / camp, plus an hero, which is 25.
So an attacker must use 225/3 - 75 troop value - Even if they don't have a hero or their army camps aren't level 6.