Thank you all for the answers.
The Rodrigues' formula did work, so let me try to give the full solution.
The solution:
Given $2$ vectors $\vec V=(v_1,v_2,v_3)$ and $\vec U=(u_1,u_2,u_3)$, we need to to find a rotation matrix $R$ such that $R\cdot$$\vec V=\vec U$
Let $\vec W= (w1, w2, w3)$ be the cross-product $\vec V$$\times$$\vec U$. Normalize it. $\vec W$ is now our rotation axis.
let $K$ be the matrix representation of $\vec W$.
$$K = \begin{bmatrix}0&-w3&w2\\w3&0&-w1\\-w2&w1&0\end{bmatrix}$$
The angle $θ$ between the two vectors $\vec U$ and $\vec V$ is:
$$θ = arcsin\Biggl(\frac{ \lVert\vec W\lVert}{\lVert\vec V\lVert\cdot\lVert\vec U\lVert}\Biggl)$$
while $\lVert\vec W\lVert$ is the lengeth of $\vec W$.
Let $I$ be the identity matrix.
The Rodrigues' formula for the rotation matrix R is as follows:
$R = I+sin(θ)\cdot$$K+(1-cos(θ))\cdot$$\mathrm{K}^2$
while $\mathrm{K}^2$ is the multiplication of the matrix K by itself.
Then, you can simply multiply $R$ by any vector to apply the same rotation on it.
That's why I asked in the begining for a rotation matrix R such that R*V=U
– Elyasaf755 Jun 13 '19 at 23:05