If your first table is named Table 1,
cell B2 =COUNTIFS(Table 1::$A,"Tim",Table 1::$B,$A2)
Or if you want to use the name in cell B1 (the text in cell B1 before the apostrophe),
=COUNTIFS(Table 1::$A,TEXTBEFORE(B$1,"'"),Table 1::$B,$A2)
The "'" is a quote apostrophe quote. I recommend you go into Numbers Preferences and turn off smart quotes so all your quotes are straight quotes and all apostrophes are straight apostrophes. Either that or use in the formula an opening smart apostrophe where I used a straight apostrophe.
Or if you change "Tim's Contracts" to just "Tim",
=COUNTIFS(Table 1::$A,B$1,Table 1::$B,$A2)