Cody is in Wyoming. Cody is where the crime was committed.
He drove from there to Bozeman/Manhattan(where he lives)/Belgrade area in Montana via Yellowstone Park, which is the most direct way when roads are open in the park.
They arrested him in Belgrade and took him to the Gallatin County Detention Facility (aka county jail), which is in Bozeman MT.
Now they have to go through extradition procedures, which is the fancy name for the paperwork and hoops that have to be gone to if you want to move an accused person from one state to face charges in another. Then he'll be back in Cody, Wyoming to face charges.
eta: here's a quick map of his route.
https://maps.google.com/maps?saddr=...oq=Belgrade&mra=dpe&mrsp=1&sz=8&via=1&t=m&z=8