  Let $\mathscr{F}$ be a holomorphic foliation of degree $2$ on $\mathbb{P}^n$
with dimension $k\geq 2$. We prove that either $\mathscr{F}$ is algebraically
integrable, or $\mathscr{F}$ is the linear pull-back of a degree two foliation
by curves on $\mathbb{P}^{n-k+1}$, or $\mathscr{F}$ has tangent sheaf
$T\mathscr{F}\simeq \mathcal{O}_{\mathbb{P}^n}(1)^{k-2}\oplus
(\mathfrak{g}\otimes \mathcal{O}_{\mathbb{P}^n})$, where $\mathfrak{g}\subset
\mathfrak{sl}(n+1,\mathbb{C})$ and either $\mathfrak{g}$ is an abelian Lie
algebra of dimension 2 or $\mathfrak{g}\simeq \mathfrak{aff}(\mathbb{C})$, or
$\mathscr{F}$ is the pull-back by a dominant rational map $\rho: \mathbb{P}^n
\dashrightarrow \mathbb{P}(1^{(n-k+1)},2)$ of a non-algebraic foliation by
curves induced by a global vector field on $ \mathbb{P}(1^{(n-k+1)},2)$. In
particular, the space of foliations of degree 2 and dimension $k\geq 2$ has
exactly 4 distinct irreducible components parameterizing non-algebraically
integrable foliations. As a byproduct, we describe the geometry of Poisson
structures on $\mathbb{P}^n$ with generic rank two.
