You’ve run a help-wanted ad in the paper for weeks with no luck. Finally, the perfect candidate applies for the job. He’s got everything—and something you never expected, a foreign passport. The growing complexities involved in hiring an American can be sufficiently exasperating without adding an entirely new mention.

Don’t panic. The rules for tax withholding on foreign workers are complicated but not impossible. If you don’t know the answers to two essential questions, however, you could find yourself liable for penalties, interest and any amounts that weren’t withheld but should have been. Here are the questions:

Will the foreign worker be an employee or an independent contractor?

Is the prospective employee a resident alien or a nonresident alien (NRA)?

The first step is to understand the terminology and how foreign workers are taxed.

Resident alien. A resident alien is someone who isn’t a U.S. citizen but who meets the so-called “green card” or the “substantial presence” test.

Green card test. Individuals are resident aliens of the United States if they are lawful permanent residents. Lawful permanent residents are those granted the privilege of residing in the U.S. as immigrants under the immigration laws. Their status is referred to as the “green card” test because these aliens hold immigration visas known as “green cards—even though the cards, which look a bit like a driver’s license, are actually rose-colored with a blue logo.

Substantial presence test. Individuals also may become resident aliens if they are physically present in the U.S. for a specified number of days. The substantial presence test is a rather complicated three-year weighted average calculation, but the bottom line is that if the total is 183 days or more, the individual is considered a resident alien.

Tax withholding is no different for a resident alien than for a U.S. citizen. If he or she is an employee, taxes are withheld just as they would be for any other employee. If the resident alien is an independent contractor, issue a 1099 and you will have no withholding obligation.

Nonresident alien. An individual who is neither a U.S. citizen nor qualified as a resident alien is an NRA. If you hire an NRA who is legally eligible to work in the U.S. becomes an employee, you will withhold against the wages, just as you would any other other employees. It is hiring an NRA as an independent contractor that the rules change.

If you hire one as an independent contractor, you must withhold tax on all payments made to them.

It is essential that you accurately identify an NRA and make sure he or she is eligible to work in the U.S. Make photocopies for your files of all relevant documents, including passports, visas, I-94s, green cards, social security cards and ITINs.

If you are hiring the individual as an employee and they don’t have a green card, ask the applicant to fill out a Form 1078 Certificate of Alien Claiming Residence in the United States.

Trusting what you are told can be a terrible trap. Often, NRAs themselves don’t understand how they are taxed, nor do they understand the importance of proper classification. Trying to calculate the substantial presence test yourself can be confusing. If you add wrong, you could be sorry. If the individual does not present you with a green card and refuses to complete Form 1078, treat him or her as an NRA.

Now that you know how to identify the NRAs, you’re ready to learn about proper reporting and withholding.

Tax withholding. All payments to NRAs are considered income and are subject to withholding unless the Internal Revenue Code or a tax treaty specifically excludes the income. The two most common methods of withholding are:

Graduated withholding for employee compensation such as wages.

l 30 percent withholding for nonemployee compensation—what you pay an independent contractor.

If the NRA is an employee, graduated withholding applies. There are specific rules for how an NRA must complete Form W-4 to avoid under-withholding:

1. Regardless of whether the NRA is married or divorced, he or she should check single when asked about marital status.

2. Withhold an additional $4 per week over what is called for.

3. Claim only one withholding allowance.

If the NRA is an independent contractor, the 30 percent withholding method applies and the rules become a bit more complicated. Unless you have knowledge of an exemption or reduced withholding rate under a treaty, you must withhold 30 percent of all payments.

Just because an independent contractor is claiming a treaty exemption does not mean he or she will automatically be exempt from withholding. You will need to know if the treaty exempts the income entirely or simply provides for a reduced withholding rate.

Whatever you withhold will be remitted to IRS under your normal tax deposit rules. Annually, you also must file Form 1042 Annual Withholding Tax Return for U.S. Source Income of Foreign Persons (similar to Form 941) with IRS and Form 1042-S Foreign Person’s U.S. Source Income Subject to Withholding with the payee (similar to a Form 1099).

To be on the safe side, assume all payments to an NRA independent contractor are taxable and subject to withholding unless you have clear evidence of the contrary.

Author Karel Hull is a senior tax manager at Moss Adams LLP, CPA, in Tacoma.