How many people were deported under the McCarthy era, and what made a person qualify for government surveillance, arrest, or deportation?
A good source on this will be Ellen Schrecker's "Immigration and Internal Security: Political Deportations during the McCarthy Era." Science & Society 60, no. 4 (1996): 393-426. You should be able to access this from any academic library.
Her basic argument is that while deportation was widely used as a threat in the McCarthy era it didn't actually happen with anything near that frequency. She notes that while ~850 individuals were deported during the Red Scare and Palmer Raids of 1919-1920, actual deportations of political subversives (i.e. Communists and other leftists) were fairly rare even at the peak of the anti-Communist hysteria of the 1950s.
Bureaucratic conflict, particularly between the Immigration and Naturalization Service and the Justice Department, as well as effective immigrant advocacy by the ACLU and other organizations, was a major factor in limiting deportations. But more broadly deportation itself was generally the final step in the process of targeting and eliminating perceived foreign-born threats to national security. Schrecker concludes that:
Most of the men and women slated for expulsion because of their communist ties never left the United States. Between 1946 and 1966 only 253 aliens were officially deported as political subversives (INS, Annual Reports, 1956-1966). The figure is low and does not include, for example, those people whom the INS was able to expel on other pretexts. Nor does it include the foreign-born radicals who voluntarily exiled themselves in response to the pressures of McCarthyism. Actual deportations were only the most drastic outcomes of INS initiatives. Incarceration, unemployment, and the financial and psychological toll of fighting deportation were the more common and often equally punitive byproducts of the process; and here the number of people affected seems to have been about 15,000. (Schrecker pg. 416).
So the short answer to OP's question is 253.
What made them targets could be just about anything someone in power didn't like, but broadly speaking the primary target categories were leftists, Communists, and others who challenged the political/economic status quo. Of course, targets also include people of color, religious and ethnic minorities, LBGTQ+ individuals, and anyone else who was either a political threat or an easy target-- basically the same bunch that McCarthy personally went after, though of course deportation specifically was only used as a threat against non-citizens.
Schrecker's article offers a lot more detail, including fascinating examinations of several individual cases as well as the political wrangling over the McCarran Act revisions in 1952 and some of the related court decisions. I'd highly recommend it to anyone interested in this specific question or the broader context for deportations during the McCarthy era.