<s>[INST] Given $2018 \times 4$ grids and tint them with red and blue. So that each row and each column... 
Given $2018 \times 4$ grids and tint them with red and blue. So that each row and each column has the same number of red and blue grids, respectively. Suppose there're $M$ ways to tint the grids with the mentioned requirement. Determine $M \pmod {2018}$.

Solution?: Each column can be colored such as $$(R,R,B,B),(R,B,R,B),(R,B,B,R),$$$$(B,B,R,R),(B,R,B,R),(B,R,R,B)$$ Say the column colorings appears $a,b,c,a',b',c'$ respectively.
Clearly we must have $a+b+c= a'+b'+c'$ since $R$ appears the same times as $B$ in first row. Simillary we have $a+b'+c' = a'+b+c$ which implies $a=a'$. The same is true for $b=b'$ and $c=c'$. So we have that $a+b+c=1009$ and thus  $$M =\sum_{a+b+c=1009}\frac{2018!}{a!^2b!^2c!^2} \equiv ?\pmod{2018}$$ 
Edit: after Ross Millikan answer.

My question here is: is this is correct and seeking for an alternative solution via generating functions.

 [/INST] This is only a response to if your way of thinking about the problem is correct.
Let's consider this a slightly different way:
$$\hat{v_1} = \begin{pmatrix}R \\ R \\ B \\ B\end{pmatrix}, \hat{v_2} = \begin{pmatrix}R \\ B \\ R \\ B\end{pmatrix}, \hat{v_3} = \begin{pmatrix}R \\ B \\ B \\ R\end{pmatrix}, \hat{v_4} = \begin{pmatrix}B \\ R \\ R \\ B\end{pmatrix}, \hat{v_5} = \begin{pmatrix}B \\ R \\ B \\ R\end{pmatrix}, \hat{v_6} = \begin{pmatrix}B \\ B \\ R \\ R\end{pmatrix}$$
Then let $v_i$ be the number of columns of type $\hat{v_i}$.
We have:
$$\sum_{i=1}^6 v_i = 2018$$
$$v_1+v_2+v_3=v_4+v_5+v_6$$
$$v_1+v_4+v_5=v_2+v_3+v_6$$
$$v_2+v_4+v_6=v_1+v_3+v_5$$
$$v_3+v_5+v_6=v_1+v_2+v_4$$
This is five equations in six variables.
In augmented matrix form:
$$\left[\begin{array}{cccccc|c}1 & 1 & 1 & 1 & 1 & 1 & 2018 \\ 1 & 1 & 1 & -1 & -1 & -1 & 0 \\ 1 & -1 & -1 & 1 & 1 & -1 & 0 \\ -1 & 1 & -1 & 1 & -1 & 1 & 0 \\ -1 & -1 & 1 & -1 & 1 & 1 & 0\end{array} \right]$$
And according to Wolframalpha, in Row Echelon form:
$$\left[ \begin{array}{cccccc|c}1 & 0 & 0 & 0 & 0 & -1 & 0 \\ 0 & 1 & 0 & 0 & -1 & 0 & 0 \\ 0 & 0 & 1 & -1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 1 & 1009 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0\end{array}\right]$$
So, this looks conclusive that your assumption was correct.
I do not have a solution involving generating functions, though.
Edit: Wolframalpha did find a closed form for this, though:
$$\sum_{a+b+c=n} \dfrac{(2n)!}{(a!)^2(b!)^2(c!)^2} = \dfrac{16^n\Gamma\left(n+\dfrac{1}{2}\right)^2 {_3}F_2\left(-n,-n,-n;1,\dfrac{1}{2}-n;\dfrac{1}{4}\right)}{\pi \Gamma (n+1)^2}$$
</s>