An enclave is a territory or country that is completely surrounded by a neighboring territory. An exclave is a portion of a country isolated from the main part by surrounding foreign territory.
In Figure 1, C is an enclave of A and an exclave of B. In Figure 2, D is an exclave of B, but, because D doesn’t lie entirely within the borders of A or C, it is not an enclave of either.
It’s possible for a territory to be an enclave but not an exclave, as is the case with Vatican City and Lesotho, an exclave but not an enclave, like Kaliningrad and Alaska, or both, like the Spanish town of Llívia. Even more bizarre nested arrangements are possible: Nahwa is an exclave of the United Arab Emirates located in the Omani territory of Madha. Madha itself is an exclave of Oman, surrounded on all sides by the UAE.