I’tikaf is a recommended action (Sunnah). It is not valid from a person who is obliged to attend the congregational salah unless he is in a masjid where the salah is held. The jama’a is wajib on the male. How then is it possible that a person stays in the masjid and there is no jama’a for 10 days? I’tikaf doesn’t need to be for 10 days, rather it can be even for an hour or so. The Hanabila and the Shafi’yyah say that it is recommended (mustahab) that if someone is going to spend a decent time in the masjid, they then intend to do i’tikaf. What is considered a decent amount of time as per the urf is what is ok to intend I’tikaf in.
A condition for I’tikaf is that one is free from anything that requires performing the purificatory bath like being in a state of janabah, menstruation or lochia etc.
If someone vows to perform I’tikaf or prayer in a masjid in other than the 3 Masajid, then one can perform the retreat in that or any other masjid as all the masajid are equal and the vow is deemed complete. But if it is one of the 3 Masajid, then the vow has to be completed in that said Masjid or in one greater than it. The most superior masjid is Masjid al-Haram in Makkah followed by Masjid Nabawi and then Masjid al-Aqsa.
One does not exit from the I’tikaf that one has vowed to perform consecutively except for something unavoidable like using the toilet, getting food etc. For one who has made a vow, the I’tikaf becomes wajib instead of just Sunnah. Such a person does not visit the sick, nor attend a funeral unless it was stipulated though such a stipulation is not valid. The person does not exit for the sake of trade or whenever he so desires without a dire necessity.
Intercourse is not permitted as it spoils the i’tikaf. So does ejaculation from foreplay or masturbation. An expiation for an oath that is broken for someone who spoils the I’tikaf which a person had vowed to complete.
A person who is performing the sunnah I’tikaf can leave the Masjid as and when required like a job, exam, appointments or its likes. The person can return to the masjid when the work is done.
It is recommended to busy oneself with acts of worship and to avoid whatever does not concern one one like debating, arguing, backbiting and frequent speech. I’tikaf is not a time for socializing but rather a time for secluding oneself with Allah. Try and vary your good deeds and have a plan on what you want to do and achieve.