Your gluteus maximus -- the muscle most people think of as the butt muscle -- performs several motions at the hip, primarily hip extension; your hamstrings bend the knee and also help extend the hip. In practical terms, this means you can exercise your glutes with hip extension exercises like mule kicks. Although two of the three muscles in your hamstrings assist with hip extension, you can more completely target this muscle group with variations on the standard leg curl.
The Staple Standards
In terms of isolating the target muscles, mule kicks, hip extensions and leg curls are the best exercises for your butt and hamstrings. All three can be performed on gym weight machines, or using elastic resistance bands or ankle weights at home.
But Wait, There's More
If you're ready for functional training -- compound exercises that mimic real-world movements -- you can also work your butt and hamstrings during with exercises like squats, deadlifts, kettlebell swings and lunges. Your hamstrings and glutes will also be hard at work during almost every type of cardiovascular exercise -- such as running and swimming -- and they powerfully activate for jumping exercises such as box jumps, ski jumps and bike jumps.