Don't connect sockets like that. Yellow outputs go to yellow inputs. Green to green and so on. Green is for shaders. The material output node is expecting a shader (green), not a texture in RGB (yellow).
Read:
What is the meaning of the color of the node sockets in the node editor?
and
Cycles - (Shader) Nodes - inputs outputs - What are the exact data types?
To have three different Shaders controlled by the brick texture the you can do the following: Use pure black (0) and white (1) for colors 1 and 2 in the brick node and either black or white for mortar.
First let's look at the output of the brick texture: black and white bricks (and some mixture depending on the value set in "Bias")
We want could use that value information as the fac to mix two different shaders Yellow Bricks and Red Bricks:
What were white bricks are now Red ones, and the black ones Yellow.
Now let's examine the contents of the Fac output from the Brick Texture:
That is the information of the "Mortar"
You can use that information to control yet another mix shader.
This way you can have a completely different shader for the mortar as well.
Additionally you can also use the Mortar as displacement.
If you need more separation between the color 1 and color 2 (so that there are less bricks that are a mix of the two colors) you can add a color ramp in between the color output of the texture and the first mix shader. That way you can control the contrast of the image for the mix.
From there on you can do whatever other adjustmets you want.
In case you are wondering... why are we connecting yellow outputs on gray input sockets? Doesn't that contradict the very first sentence on this answer? Yes there are cases where you can break the rules a little.
Yellow sockets are Red, Green, and Blue color information (RGB)
Gray ones are a single channel (greyscale) info.
By turning the color 1 and 2 to black or white we are creating grayscale information, so that can be used in a gray socket.
Likewise if you plug a gray output socket to a yellow (color) input, all you will get is monochromatic information.