Homology of complement of compact submanifold

Statement
Suppose $$M$$ is a manifold and $$K$$ is a compact connected manifold embedded as a submanifold inside $$M$$. The general problem asks for computation of the homology of $$M \setminus K$$, without any prior information about how $$K$$ has been embedded inside $$M$$.

Particular cases
In general, the answer is not determined, and depends on the way that $$K$$ sits inside $$M$$. However, for certain special cases, the answer can be determined; for instance, when $$K$$ is a single point, is the problem of point-deletion inclusion, where the answer is completely determined in terms of the homology of $$M$$, except at dimensions $$n$$ and $$n-1$$.

When the submanifold is a sphere
Suppose $$M$$ has dimension $$n$$ and $$K=S^m$$ has dimension $$m$$. Then the Alexander duality theorem yields that:

$$H_n(M, M \setminus K) = H_{n-m}(M, M \setminus K) = \mathbb{Z}$$

and all other relative homologies are 0. This puts significant constraints on the homologies of $$M \setminus K$$; nonetheless these homologies are not determined uniquely by the data.

When the manifold is compact connected orientable
If $$M$$ itself is a compact connected orientable manifold, and $$K$$ is any compact connected manifold, then we have:

$$H_n(M) \to H_n(M, M \setminus K) \to H_n(M, M \setminus p)$$

All three groups are $$\mathbb{Z}$$ and the composite is an isomorphism; this forces the map from $$H_n(M)$$ to $$H_n(M, M \setminus K)$$ to be zero. Writing down the long exact sequence of homology of a pair $$(M,M \setminus K)$$, we see that $$H_n(M \setminus K) = 0$$, and the long exact sequence can be truncated to begin at:

$$0 \to H_{n-1}(M \setminus K) \to H_{n-1}(M) \to \ldots$$

When the manifold and submanifold are spheres
A special case of both the above occurs when $$M = S^n$$ and $$K$$ is homeomorphic to $$S^m$$, $$m < n$$. In this case, the homologies of the complement of $$K$$ in $$M$$ can be determined completely, using the two observations above, and the fact that all lower reduced homologies of $$M$$ are zero.

What we deduce is that the homologies of the complement are $$\mathbb{Z}$$ at $$n-m-1$$ and $$0$$ if $$m \ne n - 1$$, and $$\mathbb{Z} \oplus \mathbb{Z}$$ at $$0$$ if $$m = n-1$$. Homologies are 0 elsewhere.

A very special case of this is $$S^1$$ inside $$S^3$$, which is a knot. For this, the zeroth and first homologies are $$\mathbb{Z}$$, and all other homologies are zero.

When the submanifold has codimension 1
Another particular case of interest is when the whole manifold is simply connected, and the submanifold is compact and connected with codimension 1. It turns out that under these conditions, the submanifold is separating and is also orientable.