If $\vec A$ and $\vec B$ are two vectors such that $\vec A=<A_x,A_y,A_z>$ and $\vec B=<B_x,B_y,B_z>$ then
$$\nabla({\vec A}.{\vec B})=A \times (\nabla \times B)+B \times (\nabla \times A)+(A.\nabla)B+(B.\nabla)A$$
In this relation what does this $(A.\nabla)B$ imply? How does this work on vector? Isn't gradient meant to be operated on scalar function?
The operator $\vec A\cdot\nabla$ is the directional derivative operator in the direction $\vec A$. If you have some experience with analysis, you might know that if $f:\mathbb R^n\to\mathbb R^n$ is totally differentiable with Jacobian $\mathrm Jf(x)$ in $x$, then all its directional derivatives exist and can be calculated as $\mathrm Jf(x)v$, where $v$ is the direction.
Sometimes this is also written as $(\nabla f)^T v$, using the nabla operator. We can write this as
$$(\nabla f)^Tv=(\partial_1 f)v_1+\dots+(\partial_n f)v_n.$$
Keep in mind that $\partial_i f$ are vector valued functions. This expression we could also write as $(v_1\partial_1+\dots+v_n\partial_n)f$. Formally, the expression in parentheses is just $v\cdot\nabla$, so we can write the whole thing as
$$(\nabla f)^T v=(v\cdot\nabla)f.$$
The takeaway is: $v\cdot\nabla$ is the directional derivative operator in direction $v$ because $(v\cdot\nabla)f=(\nabla f)^T v$, and the expression on the right side is known to give you the directional derivative.