Won't idle (stalls)

stalls
#1

2000 nissan maxima will start and idle fine when first started in the morning. When engine warms up it drives, but won’t remain idling (stalls) when put in “park” or “neutral”. Yet when left in “drive”, it will idle fine.

#2

Usually they stall in “drive” and idle better in “park” and “neutral”