Most likely you are being confused because he wrote every variable as a capital letter instead of the usual convention: matrices are capital, and vectors are lowercase. In your situation, $y$ is a column vector, $X$ is a matrix, $b$ is a column vector, and $e$ is a column vector.
Therefore you have:
$$e'e=y'y-2y'Xb+b'X'Xb$$
Taking the gradient with respect to all of the elements in the column vector $b$ (and if $b$ is a column vector, we usually assume that the gradient of any function $f(b)$ will also be a column vector):
$$\cfrac{d e'e}{db} = 0 - 2X'y + 2X'Xb$$
Note that if we do _not_ take transpose of $y'X$, we will get a row vector and you would not be able to "add" the row vector and column vectors. Just to keep things consistent, we must transpose the vector $y'X$ to get all column vectors: $0$, $-2X'y$, and $2X'Xb$.