Trouble shooting?

I know this is an RZR forum but I also know that more people here have the knowledge to help. My brother in law has an 2013 ranger 500. It will start and idle at about 3500 RPM for a few minutes then die. If you start it in gear and keep rpms up it will stay running. As soon as you come to a stop it dies. You can start again in gear and take off.
Any Ideas what to look for?