As with other devotions, there are some conditions of itikaf. We can list them as follows:
1- Intention. Intention is a must in itikaf as it is in other prayers. Waiting in the mosque without an intention is not considered itikaf.
2- Man entering itikaf in a masjid where prayers are performed 5 times a day. The most virtuous one of the itikaf is the one in Masjid al-Haram, then in Masjid an-Nabawi, then in Masjid al-Aqsa. The virtue in other masjids varies according to the number of the people usually praying there.
3- Fasting. It is a condition for itikaf that is wajib.
4- Women being clean of menstruation and obstetrics. Since being junub does not prevent fasting, taharah is not necessary even in the wajib itikaf. Therefore, if there is unsureness in the masjid that itikaf is done in, itikaf will still be valid.