In my ford escape, the ac compressor turns on for only two seconds?

2010 6 cyl

It's probably low on refrigerant. The pressure switch turns the compressor off to prevent damage from running it while low on refrigerant. When the system loses (leaks) a little more refrigerant, the compressor won't come on at all. Pretty much true on all cars. Take it some place and have the refrigerant level topped off while the compressor is able to run, will be cheaper than if it won't run at all.

Check the high pressure switch to see if that's why it cuts out as soon as the compressor kicks in. Air in the system will kick the high switch, the low switch stops it completely. I'm no A/C guy so my advice is to take it to a shop and pay like I do.