Let $\vec{a},\vec{b},\vec{c}$ be vectors in $\mathbb{R}^{3}$.
Is defined their triple vector product
$$
\mathbf a \times (\mathbf b \times \mathbf c)
$$
where $\times$ denotes the cross product.
Warning:
As the cross product is not associative:
$$
\mathbf a \times (\mathbf b \times \mathbf c) \ne (\mathbf a \times \mathbf b)\times \mathbf c
$$
Identity
$$\vec{a}\times(\vec{b}\times\vec{c})=\vec{b}(\vec{a}\cdot\vec{c})-\vec{c}(\vec{a}\cdot\vec{b})$$
where $\times$ denotes the cross product and $\cdot$ the dot product.[1]
Mnemonics: bac-cab: Ax(BxC)=B(AC)-C(AB)
Let $\vec{a}=a_1\hat i+a_2\hat j+a_3\hat k,\, \vec{b}=b_1 \hat i+b_2\hat j+b_3\hat k,\, \vec{c}=c_1\hat i+c_2\hat j+c_3\hat k$.
By definition,
$$
\vec{b}\times\vec{c}=(b_2c_3-b_3c_2,\; b_3c_1-b_1c_3,\; b_1c_2-b_2c_1).
$$
Now calculate the $\hat i$ term of the left-hand side:
$$
\begin{aligned}
\bigl(\vec{a}\times(\vec{b}\times\vec{c})\bigr)_{\hat i}
&=a_2(b_1c_2-b_2c_1)-a_3(b_3c_1-b_1c_3)\\
&=(a_2b_1c_2+a_3b_1c_3-(a_2b_2+a_3b_3)c_1),
\end{aligned}
$$
and the $\hat i$ term of the right-hand side:
$$
\begin{aligned}
\bigl((\vec{a}\cdot\vec{c})\vec{b}-(\vec{a}\cdot\vec{b})\vec{c}\bigr)_{\hat i}
&=(a_1c_1+a_2c_2+a_3c_3)b_1-(a_1b_1+a_2b_2+a_3b_3)c_1\\
&=a_1b_1c_1+a_2b_1c_2+a_3b_1c_3-a_1b_1c_1-(a_2b_2+a_3b_3)c_1\\
&=(a_2b_1c_2+a_3b_1c_3-(a_2b_2+a_3b_3)c_1),
\end{aligned}
$$
which is identical to the $\hat i$ term of the left handside.
Similarly, by simple calculation it can be demonstrated that the $\hat j, \hat k$ terms are identical on both sides as well.*
* Intuition: Vector space $\mathbb{R}^3$ has no preferred direction. There is nothing special about $\hat i$ compared to $\hat j$ or $\hat k$.
For $\vec{a}=(1,2,4)$, $\vec{b}=(2,2,0)$, and $\vec{c}=(1,3,0)$,
$$
\vec{a}\cdot\vec{b}=2+4+0=6,
\qquad
\vec{a}\cdot\vec{c}=1+6+0=7,
$$
By identity,
$$
\begin{aligned}
\vec{a}\times(\vec{b}\times\vec{c})
&=7\,(2,2,0)-6\,(1,3,0)\\
&=(14,14,0)-(6,18,0)\\
&=(8,-4,0).
\end{aligned}
$$
By definition,
$$
\begin{aligned}
\vec{b}\times\vec{c}&=(2\cdot 0-0\cdot 3,\; 0\cdot 1-2\cdot 0,\; 2\cdot 3-2\cdot 1)=(0,0,4),\\
\vec{a}\times(0,0,4)&=(2\cdot 4-4\cdot 0,\; 4\cdot 0-1\cdot 4,\; 1\cdot 0-2\cdot 0)=(8,-4,0).
\end{aligned}
$$
Applications
Centripetal acceleration
A point $P$ of rigid body rotating with angular velocity $\vec{\omega}$ about a fixed point $O$ has centripetal acceleration
$$
\vec a_{cen.}=\vec \omega \times \vec v
$$
where $\vec v$ is its velocity vector
Since
$$
\vec{v}=\vec{\omega}\times\vec{r}
$$
where $\vec{r}=\vec{OP}$
Hence
$$
\vec a_{cen.}=\vec{\omega}\times(\vec{\omega}\times\vec{r})=\vec \omega (\vec{\omega}\cdot\vec{r})-\vec r|\vec{\omega}|^{2}|
$$
Angular momentum
The angular momentum of an element mass rotating with angular velocity $\vec{\omega}$ about a fixed point $O$ is
$$
\vec L=\vec r \times \vec v
$$
where $\vec v$ is its velocity vector
Since
$$
\vec{v}=\vec{\omega}\times\vec{r}
$$
where $\vec{r}=\vec{OP}$
Hence
$$
\vec L=\vec{r}\times(\vec{\omega}\times\vec{r})=\vec \omega \left\|\vec r \right\|^2-\vec r (\vec r \cdot \vec \omega)
$$