I suspect you haven't got a quick answer because it's kind of difficult to see the overall pattern unless you're prepared to wade through all the trip constructions for JFK on both the 744 and the 777..and life's too short.
Certainly (for Flight Crew) "first in, first out" happens the majority of the time but not always, and there's also a bit of positioning, no doubt to avoid long lay overs/slips..