You want to take to AirTrain from any terminal to JAMAICA ($5) where you will take the Long Island Railroad to Farmingdale ($5.75 off peak) then once you are off the train there are taxis or you can take the N70 Nassau bus but make sure you have change if you want to do this. The trip to the farmingdale station is no more than an hour, there are trains from the airport every 10 mins and from jam to farmingdale every hour (9:10,10:10, 11:09... Etc)
You want to take to AirTrain