This can be achieved with the help of Sets in Tableau or using a Filter. Let's look at the procedure for both with this sample dataset.
+--------+--------+------+
| ClassA | ClassB | Name |
+--------+--------+------+
| 1 | 1 | Abc |
| 0 | 0 | Def |
| 0 | 1 | Ghi |
| 0 | 1 | Jkl |
| 0 | 1 | Mno |
| 1 | 0 | Pqr |
| 1 | 0 | Stu |
| 1 | 0 | Vwx |
| 1 | 1 | yz |
+--------+--------+------+
Set - Let’s create a set from name the 'Name' field as shown below
Filter - Add ClassA and ClassB to the filter and select the values you want to see. Here is the screenshot of the output of adding a filter