I suppose that $S^2_B(\Lambda^2(\mathbb{R}^n))$ means the subspace of $S^2(\Lambda^2(\mathbb{R}^n))$ that satisfies the Bianchi identity, i.e., the kernel of the natural map $$ S^2(\Lambda^2(\mathbb{R}^n))\longrightarrow \Lambda^4(\mathbb{R}^n). $$ $S^2(\Lambda^2(\mathbb{R}^n))\longrightarrow \Lambda^4(\mathbb{R}^n)$.
In addition, one needs that $R$ be invariant under the action of this $G$ on $S^2(\Lambda^2(\mathbb{R}^n))$. Conversely, if this invariance holds, then $R$ is the curvature of an irreducible $n$-dimensional symmetric space with holonomy $G$. The
The reason is that one then can define a Lie algebra structure on ${\frak{l}} = {\frak{g}}\oplus \mathbb{R}^n$ as follows: Let the bracket on ${\frak{g}}\subset{\frak{l}}$ be the usual bracket on ${\frak{g}}$; for $a\in{\frak{g}}\subset{\frak{so}}(n)$ and $x\in \mathbb{R}^n$, set $[a,x]=-[x,a]=ax$; and for $x$ and $y$ in $\mathbb{R}^n$, set $[x,y]= R(x{\wedge}y)$. (Here, we are regarding $R$ as a symmetric mapping $R:\Lambda^2(\mathbb{R}^n)\to \Lambda^2(\mathbb{R}^n)$, knowing that it has image in ${\frak{g}}\subset \Lambda^2(\mathbb{R}^n)$.) Then the assumption that $R$ lies in $S^2_B(\Lambda^2(\mathbb{R}^n))$ is just that $R(x{\wedge}y)z+R(y{\wedge}z)x+R(z{\wedge}x)y=0$ while the assumption that $R$ is invariant under $G$ implies that $a\ R(x{\wedge}y)-R(x{\wedge}y)\ a = R(ax{\wedge}y + x{\wedge}ay)$, and these are exactly the equations that needed to verify that the bracket defined as above on ${\frak{l}}$ satisfies the Jacobi identity. Then the pair $({\frak{l}},{\frak{g}})$ is a symmetric pair, so that, by Cartan's construction, there is an $n$-dimensional Riemannian symmetric space $M=L/G$ with holonomy $G$ and having $R$ as its curvature operator.
Added remark: The OP wanted a criterion that didn't explicitly mention a Lie algebra $\frak{g}$, and one can do it this way: If one just defines $\frak{g}$ to be the image of $R$ in $\Lambda^2(\mathbb{R}^n)$ when one regards $R$ as a symmetric map from $\Lambda^2(\mathbb{R}^n)$ to itself, then the condition that $$ R(w{\wedge}z)\ R(x{\wedge}y)-R(x{\wedge}y)\ R(w{\wedge}z) = R\bigl(R(w{\wedge}z)x{\wedge}y\bigr) + R\bigl(x{\wedge}R(w{\wedge}z)y\bigr) $$ hold for all $x,y,w,z\in\mathbb{R}^n$ implies both that $\frak{g}$ be closed under Lie bracket (so that $\frak{g}$ is a Lie algebra and that $R$ be invariant under the action of the connected Lie subgroup $G\subset\mathrm{SO}(n)$ whose Lie algebra is $\frak{g}$. Thus, the above system of (quadratic) equations on $R$ is exactly the algebraic condition that $R\in S^2_B\bigl(\Lambda^2(\mathbb{R}^n)\bigr)$ be the curvature operator of a symmetric space. It's also, not surprisingly, the condition that the bracket defined above on $\frak{l}=\frak{g}\oplus\mathbb{R}^n$ satisfy the Jacobi identity. This may be more along the lines of what the OP had in mind with his question.