The answer to your question is in the following equations :
\begin{equation}
\boxed{\:\:\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right) \boldsymbol{=}\left(\partial_{\mu}A^{\mu}\right)^2\boldsymbol{+}\overbrace{\partial_{\nu}\left(A_{\mu}\partial^{\mu}A^{\nu}\!\boldsymbol{-}\!A^{\nu}\partial^{\mu}A_{\mu}\right)}^{\textbf{4-divergence}}\vphantom{\dfrac{\dfrac{a}{b}}{\dfrac{a}{b}}}\:\:}
\tag{a}\label{a}
\end{equation}
so that for the variation of the action integral of this part of the Lagrangian density $\:\mathcal{L}$
\begin{equation}
\!\!\!\!\!\!\!\boxed{\:\:\delta\!\!\iiiint\limits_{\textbf{spacetime}}\!\!\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right)\mathrm d^4x \boldsymbol{=}\delta\!\!\iiiint\limits_{\textbf{spacetime}}\!\!\left(\partial_{\mu}A^{\mu}\right)^2\mathrm d^4x\boldsymbol{+}\!\overbrace{\delta\!\!\iiiint\limits_{\textbf{spacetime}}\!\!\partial_{\nu}\left(A_{\mu}\partial^{\mu}A^{\nu}\!\boldsymbol{-}\!A^{\nu}\partial^{\mu}A_{\mu}\right)\mathrm d^4x}^{0}\vphantom{\dfrac{\dfrac{a}{b}}{\dfrac{a}{b}}}\:\:}
\tag{b}\label{b}
\end{equation}
since the 4-volume integral of this 4-divergence is equal to the $^{\prime\prime}$flux$^{\prime\prime}$ of the 4-vector function through the 4-dimensional boundary surface with its space part extending to infinity and the time part between initial and final time moments $\:t_1,t_2\:$ respectively.
This means that you could replace in the Lagrangian density $\:\mathcal{L}$ the term $\:\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right)\:$ by the term $\:\left(\partial_{\mu}A^{\mu}\right)^2\:$ without affecting the extremization of the action and so the Euler-Lagrange equations of motion. These two terms are not equal, they differ by a 4-divergence.
$\boldsymbol{=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=}$
Proof of equation \eqref{a}
If $\:f(\cdots,x^{\alpha},\cdots)\:$ and $\:g(\cdots,x^{\alpha},\cdots)\:$ are scalar functions and $\:x^{\alpha}\:$ is a common variable in the set of variables they depend on, then for the partial differentiation
\begin{equation}
\partial_{\alpha}\boldsymbol{\equiv}\dfrac{\partial}{\partial x^{\alpha} }
\tag{01}\label{01}
\end{equation}
of their product we have
\begin{equation}
\partial_{\alpha}\left(fg\right)\boldsymbol{=}f(\partial_{\alpha}g)\boldsymbol{+}(\partial_{\alpha}f)g
\tag{02}\label{02}
\end{equation}
So by a first step
\begin{equation}
\!\!\!\!\!\left.
\begin{cases}
\:\:\:\partial_{\alpha} \boldsymbol{=}\partial_{\nu}\\
\:\:\:f \hphantom{_{\alpha}}\!\boldsymbol{=}A_{\mu}\\
\:\:\:g \hphantom{_{\alpha}}\!\boldsymbol{=}\partial^{\mu}A^{\nu}
\end{cases}\right\}
\quad\stackrel{\eqref{02}}{\boldsymbol{=\!=\!=\!=\!\Longrightarrow}}\quad
\boxed{\:\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right) \boldsymbol{=}\partial_{\nu}\left(A_{\mu}\partial^{\mu}A^{\nu}\right)\boldsymbol{-}A_{\mu}\left(\partial_{\nu}\partial^{\mu}A^{\nu}\right)\vphantom{\dfrac{\tfrac{a}{b}}{\tfrac{a}{b}}}\:}
\tag{03}\label{03}
\end{equation}
Now, if we suppose that it's permissible to interchange the partial derivatives $\:\partial_{\nu},\partial^{\mu}\:$ then for the last to the right term of equation \eqref{03} we have
\begin{equation}
A_{\mu}\left(\partial_{\nu}\partial^{\mu}A^{\nu}\right)\boldsymbol{=}A_{\mu}\left(\partial^{\mu}\partial_{\nu}A^{\nu}\right)
\tag{04}\label{04}
\end{equation}
By a second step for the last to the right term of equation \eqref{04} we have
\begin{equation}
\!\!\!\!\!\left.
\begin{cases}
\:\:\:\partial_{\alpha} \boldsymbol{=}\partial^{\mu}\\
\:\:\:f \hphantom{_{\alpha}}\!\boldsymbol{=}A_{\mu}\\
\:\:\:g \hphantom{_{\alpha}}\!\boldsymbol{=}\partial_{\nu}A^{\nu}
\end{cases}\right\}
\quad\stackrel{\eqref{02}}{\boldsymbol{=\!=\!=\!=\!\Longrightarrow}}\quad
\boxed{\:A_{\mu}\left(\partial^{\mu}\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\partial^{\mu}\left(A_{\mu}\partial_{\nu}A^{\nu}\right)\boldsymbol{-}\left(\partial^{\mu}A_{\mu}\right)\left(\partial_{\nu}A^{\nu}\right)\vphantom{\dfrac{\tfrac{a}{b}}{\tfrac{a}{b}}}\:}
\tag{05}\label{05}
\end{equation}
But
\begin{equation}
\left(\partial^{\mu}A_{\mu}\right)\left(\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\left(\partial_{\mu}A^{\mu}\right)\left(\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\left(\partial_{\mu}A^{\mu}\right)^2
\tag{06}\label{06}
\end{equation}
while the term $\:\partial^{\mu}\left(A_{\mu}\partial_{\nu}A^{\nu}\right)\:$ by interchanging $\:\mu,\nu\:$
and inverting the position (up to down - down to up) of its four indices yields
\begin{equation}
\partial^{\mu}\left(A_{\mu}\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\partial^{\nu}\left(A_{\nu}\partial_{\mu}A^{\mu}\right)\boldsymbol{=}\partial_{\nu}\left(A^{\nu}\partial^{\mu}A_{\mu}\right)
\tag{07}\label{07}
\end{equation}
Combining equations \eqref{04},\eqref{05},\eqref{06} and \eqref{07} we have
\begin{equation}
\boxed{\:A_{\mu}\left(\partial_{\nu}\partial^{\mu}A^{\nu}\right)\boldsymbol{=}\partial_{\nu}\left(A^{\nu}\partial^{\mu}A_{\mu}\right)\boldsymbol{-}\left(\partial_{\mu}A^{\mu}\right)^2\vphantom{\dfrac{\tfrac{a}{b}}{\tfrac{a}{b}}}\:}
\tag{08}\label{08}
\end{equation}
and inserting this expression in equation \eqref{03} we have finally
\begin{equation}
\boxed{\:\:\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right) \boldsymbol{=}\partial_{\nu}\left(A_{\mu}\partial^{\mu}A^{\nu}\!\boldsymbol{-}\!A^{\nu}\partial^{\mu}A_{\mu}\right)\boldsymbol{+}\left(\partial_{\mu}A^{\mu}\right)^2\vphantom{\dfrac{\dfrac{a}{b}}{\dfrac{a}{b}}}\:\:}
\tag{09}\label{09}
\end{equation}
that is equation \eqref{a}.
$\boldsymbol{=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=}$
Addendum
In a system $\:\mathrm{Oxyz}t\:$ with $\:\phi, \mathbf{A} \boldsymbol{=}\left(\mathrm{A_x},\mathrm{A_y},\mathrm{A_z}\right)\:$ the scalar and vector potentials the terms appeared in the main section of the answer are expressed as follows :
\begin{align}
&\!\!\!\!\!\!\!\!\!\!\!\!\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right)
\boldsymbol{=}\left(\dfrac{\partial\phi}{c^2\partial t}\right)^2\!\!\boldsymbol{+}\dfrac{2}{c^2}\left(\boldsymbol{\nabla}\phi\boldsymbol{\cdot}\dfrac{\partial\mathbf{A}}{\partial t}\right)\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\right)^2\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\right)^2\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\right)^2
\nonumber\\
&\!\!\!\!\!\!\!\!\!\!\!\! \hphantom{\boldsymbol{==}}\boldsymbol{+}2\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm y}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm x}\boldsymbol{+}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm z}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm y}\boldsymbol{+}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm x}\dfrac{\partial\mathrm{A_x}}{\partial \mathrm z}\right)
\tag{A-01}\label{A-01}\\
&\!\!\!\!\!\!\!\!\!\!\!\!\left(\partial_{\mu}A^{\mu}\right)^2 \boldsymbol{=}\left(\dfrac{\partial\phi}{c^2\partial t}\right)^2\boldsymbol{+}\dfrac{2}{c^2}\left(\dfrac{\partial\phi}{\partial t}\boldsymbol{\nabla}\boldsymbol{\cdot}\mathbf{A}\right)\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\right)^2\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\right)^2\boldsymbol{+}\left(\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\right)^2
\nonumber\\
&\!\!\!\!\!\!\!\!\!\!\!\! \hphantom{\boldsymbol{==}}\boldsymbol{+}2\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\boldsymbol{+}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\boldsymbol{+}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\right)
\tag{A-02}\label{A-02}\\
&\!\!\!\!\!\!\!\!\!\!\!\!\left(\partial_{\nu}A_{\mu}\right)\left(\partial^{\mu}A^{\nu}\right)\boldsymbol{-}\left(\partial_{\mu}A^{\mu}\right)^2 \boldsymbol{=}\dfrac{2}{c^2}\left(\boldsymbol{\nabla}\phi\boldsymbol{\cdot}\dfrac{\partial\mathbf{A}}{\partial t}\boldsymbol{-}\dfrac{\partial\phi}{\partial t}\boldsymbol{\nabla}\boldsymbol{\cdot}\mathbf{A}\right)\boldsymbol{+}2\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm y}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm x}\boldsymbol{+}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm z}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm y}\boldsymbol{+}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm x}\dfrac{\partial\mathrm{A_x}}{\partial \mathrm z}\right)
\nonumber\\
& \hphantom{\boldsymbol{==}}\boldsymbol{-}2\left(\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\boldsymbol{+}\dfrac{\partial\mathrm{A_y}}{\partial \mathrm y}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\boldsymbol{+}\dfrac{\partial\mathrm{A_z}}{\partial \mathrm z}\dfrac{\partial\mathrm{A_x}}{\partial \mathrm x}\right)
\tag{A-03}\label{A-03}
\end{align}
\begin{align}
A_{\mu}\partial^{\mu}A^{\nu}\boldsymbol{-}A^{\nu}\partial^{\mu}A_{\mu} &\boldsymbol{=}\boldsymbol{H}\boldsymbol{=} \left(h^{0},h^{1},h^{2},h^{3}\right)\boldsymbol{=} \left(h^{0},\boldsymbol{h}\right) \quad \text{where}
\nonumber\\
h^{0} &\boldsymbol{=}\dfrac{1}{c}\left(\mathbf{A}\boldsymbol{\cdot}\boldsymbol{\nabla}\phi\boldsymbol{-}\phi\boldsymbol{\nabla}\boldsymbol{\cdot}\mathbf{A}\right)
\nonumber\\
\boldsymbol{h} &\boldsymbol{=}\dfrac{1}{c^2}\left(\phi\dfrac{\partial\mathbf{A}}{\partial t}\boldsymbol{-}\mathbf{A}\dfrac{\partial\phi}{\partial t}\right)\boldsymbol{+}\left(\mathbf{A}\boldsymbol{\cdot}\boldsymbol{\nabla}\right)\mathbf{A}\boldsymbol{-}\mathbf{A}\boldsymbol{\nabla}\boldsymbol{\cdot}\mathbf{A}
\tag{A-04}\label{A-04}
\end{align}
The expression of the rhs of equation \eqref{A-03} is the 4-divergence of the 4-vector $\:\boldsymbol{H}\:$ defined by \eqref{A-04}.
$\boldsymbol{=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=}$
Link : Expanding electromagnetic field Lagrangian in terms of gauge field
$\boldsymbol{=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=}$
Reference : "Field Quantization" by W.Greiner and J.Reinhardt, Springer 1996, 6.1 The Lagrangian of the Maxwell Field (Problem and Solution).