Which state withholds depends on where the employee works, where they live, and what the two states have agreed.
An employee who lives in one state and works in another is the hardest ordinary case in payroll tax. Three rules decide it: whether the states have a reciprocity agreement, whether the home state taxes residents on income earned elsewhere, and whether the employer has a legal presence (nexus) in the home state.
Example 1: reciprocity. Works in Pennsylvania, lives in New Jersey
Paid $3,000.00 biweekly. Pennsylvania and New Jersey have an agreement, so the engine does not withhold Pennsylvania income tax, and withholds New Jersey's instead:
Tax
Amount
Pennsylvania Unemployment Compensation (Employee)
$2.10
PA Local Earned Income Tax
$102.75
New Jersey Income Tax (withheld by PA employer under reciprocity)
$121.05
Example 2: no agreement. Works in New York, lives in New Jersey
New York taxes the work, and New Jersey taxes its residents' worldwide income, with a credit for the tax paid to New York. When the employer has nexus in New Jersey and elects to withhold for it, the engine returns both:
Tax
Amount
New York Income Tax
$140.28
New York Paid Leave (Employee)
$12.96
New York Disability Benefits (Employee)
$1.20
What to send
Set workState and residenceState, and where there is no agreement, residenceStateWithholding with whether the employer has nexus and whether it withholds voluntarily. Those are legal and business facts the engine cannot determine; the request carries them, and the default is that a residence state does not withhold.
Local taxes follow the same logic: see local payroll tax, and use the address lookup to find both states from two addresses.
Which state do I withhold for if my employee lives in another state?
Usually the work state. If the two states have a reciprocity agreement and the employee has filed the certificate, the home state instead. Some home states also tax residents on out-of-state wages, which can require withholding for both.
What is nexus for payroll tax?
A legal presence in a state, such as an office or employees there, that can require an employer to register and withhold in that state. It is a fact about the employer that the request carries, because the engine cannot determine it.