As soon as you see Sniper commit to a strategy of rapid upteching and relatively high center pressure with lights and weaker troops. Upgrade infantry with automatics and use them on the flanks.
Why pressure center more than usual? It's easier to flank a sniper in the middle by rotating high DPS squads into his retreat path while he is pressured by an M20 and cheaper troops, then it is to use riflemen center and flank with M20, because good players have mines and waiting Ostruppen/Grens.
In terms of teching:
Go LT, the LT himself plus M20 is all you should need to beat one sniper. (Along with 3 rifles.)
Captain tier is not designed to be effective against Snipers, but you can get lucky with the pack howitzer.
Grenade tech after M20 is recommended to help you harass with smoke without getting sniped.
And how do you deal with the 2x 222 with a M20 and grenades upgrades? Not saying to not go M20, but you can't really follow it with grenades, unless you manage to kill one with a lucky mine (which cost you more munitions making thus grenade even less relevant).
I'll say it depends on the map and how you manage to pressurize him early game, but if you don't plan to go capt T2, unlock BARs/Zook en equip a pair on your REs if you see a 222, otherwise BARs on your rifles.
Bear in mind that a M20 is also a fantastic sniper on its own, use it wisely to snipe his models from max range. Force him to take risks to take it down, He'll have less time to micro his sniper if you bleed him first.
Then, honestly, USF vs Ost+sniper is only a matter of micro/skill/concentration, the first who commit the wrong move lose.