$T$ is the set (say $S^\ast$) of all finite unionsintersections of finite intersectionsunions of elements of $S$.
Indeed, clearly $T\supseteq S^\ast$. It is also clear that $S^\ast$ is closed wrt to finite unionsintersections. Finally, $S^\ast$ is closed wrt to finite intersectionsunions, because $$\bigcap_{j=1}^n\bigcup_{i_j\in I_j}A_{i_j,j} =\bigcup_{(i_1,\dots,i_n)\in I_1\times\cdots\times I_n}\,\bigcap_{j=1}^n A_{i_j,j}$$$$\bigcup_{j=1}^n\bigcap_{i_j\in I_j}A_{i_j,j} =\bigcap_{(i_1,\dots,i_n)\in I_1\times\cdots\times I_n}\,\bigcup_{j=1}^n A_{i_j,j}$$ for any sets $A_{i,j}$ and any index sets $I_j$, and finite intersections of finite intersections of sets are finite intersections -- use now the displayed identity for the case when each of sets.
Similarly/dually,the $T$$A_{i,j}$'s is the setunion of allfinitely many elements of $S$, and the fact that finite intersectionsunions of finite unions of elementssets are finite unions of $S$sets.
Cf. conversion to the conjunctive normal form and the disjunctive normal form.