Players often fail in defending their village because they do not know how to react or they react too late. With a successful defence, a player can harm the attacker and even prevent the conquering.

Precautions

Spies
Spies are often underestimated but they are very cheap and can prevent attacks very easily. A player looking for a conquer-victim will often be put off your village if his attempt to scout it fails as there is a risk his army will get wiped out. In addition, even if the attacker succeeds in scouting your village, with spies you will know that you have been scouted.

City wall / palisade / earth wall
This defence structure increases the defence value of the troops inside the village by up to 81% (for exact values look at the building pages). With this bonus even a relatively small army can be devastating.

Alliance
A good alliance not only discourages possible attackers with its name but will also provide you with defence in case of an attack. Diplomacy is important!

Celebrations
If possible, each village should have a Town Hall level 10 so that you can start big celebrations which will influence administrators in your favour. Furthermore the celebrations will grant you culture points to help you found another village.

Analyse the attacks

There are three types of attack:

The velocity of your army depends on the slowest unit participating. Rams and even more so catapults are necessary to conquer a village (by destroying the palace or residence), but they are the slowest units for each tribe. When you see an inbound attack you can check its origin via the rally point and work out what the slowest unit in the attack is. You can use this travel time calculator to help you. As you need to see an inbound attack as soon as possible after it has been launched, activity is an important factor.
Furthermore several waves are signs of a conquering but remember that they might be fakes. Also check the village that has been chosen as victim. A 300 inhabitant village won't be target of a conquering in most cases (although they might be if they are a 9 or 15 cropland). A high population village or a strategic village like your army camp/training village are likely to be a target.

The conquering waves are: a cleaner which will destroy the enemy's defence (including walls in most cases), followed by catapults (to destroy the palace or residence) and then the administrators (to lower the loyalty). This scheme is most common but does not apply to every conquering. Sometimes they are combined or divided by additional cleaning waves or fakes. Also the attacker will try to time the attacks so that the conquering will take place in very few seconds to make it so that the defender will be unable send defence in-between.

Defence strategies

Defenders have several different ways to react depending on the initial situation.
First of all, even if you have lost all hope, using a suitable strategy may harm the attacker and you will learn how to react better ready for the next time when someone wants to conquer your village(s).
Always keep in mind that the attacker also had to learn how to conquer a village and had to improve his strategy. Every inbound attack is a way you to improve you defensive skills!

The wall
This strategy involves filling your village with as many defensive troops as possible and hoping that they are enough to crush the attacker's army. Keep in mind that you should use mixed troops because you do not know if you will be fighting infantry or cavalry.
The troops should be in the village before the first attacks arrives. You can even combine armies of different villages and players in one huge defence army which the attacker cannot. You should write messages to your alliance and friends to ask for sufficient crop so that the troops won't starve to death before it comes to the fighting.

The wave splitter
Using this strategy is a bit iffy, especially against well trained attackers, but it can be done successfully with very few troops. If you aren't sure that you can do this but you want to try it, you should combine it with the wall for your own safety.
In this strategy, the cleaning wave is ignored and defensive troops will be timed in between this cleaning wave and the catapults. This means that you will just lose some resources, perhaps a building and very few troops.
Keep in mind that the attacker might ask his friends to send a second cleaning wave or he will attack in such a way that the waves will arrive in quick succession so that it will be almost impossible to send defence in-between.

The celebration defence
In this strategy you will defend with big celebrations. They lower the effectiveness of enemy senators/chiefs/chieftains by up to 5% so that the attacker will need to send more of them. If the attacker sends too few of them your villages loyalty will not be lowered enough. This strategy is very, very risky as a cautious attacker will always send enough senators/chiefs/chieftains to outrun a big celebration's effect. 

Using tablet of laws (hero item)
This hero item raises the loyalty in the home town of the hero for 1% for each tablet, to a maximum of 125%, so that the attacker will need to send more senators/chiefs/chieftains. If the attacker sends too few of them your villages loyalty will not be lowered enough. This strategy is very, very risky as a cautious attacker will always send enough senators/chiefs/chieftains to outrun this effect.

The counter attack

Re-Conquering

Take advantages of your enemy's mistakes

In many cases you will not have to deal with a professional player and even if you do no one is perfect. The mistakes of the attacker should be used to your advantage regardless of who attacks! Every chance you get to prevent the conquering is a bonus.

Fake attacks
The following are signs that an attack could be a fake:

Including allies
If the attacker includes his/her allies then you can be relatively certain that they will send either an additional cleaning wave or catapults, especially if the attacker is weak. But beware, the ally might have sent just some additional fakes after all!

Uncontrollable circumstances
Sadly technical problems delay or play havoc with your plans from time to time: