Taqiyya aims to save the life, dignity and wealth of the believers. Taqiyya has been mentioned in Quran (Sura 3, Verse 28).
Taqiyya can be obligatory when it is the only way to save life of the believer or believers.
Taqiyya is recommended when it improve or strengthen the relations between Muslims.
Taqiyyah is allowed to save the wealth.
Taqiyya is forbidden (Haraam) if it causes a sinful act.
Al-Shaikh Al-Mufeed has mentioned these four types of Taqiyya in his book Awaa'il al-Maqalaat, page 135 and 135.