As Bart mentioned, Izotope is a powerful tool for removing bg sounds and evening out inconsistent dialogue levels. Yes, the software is expensive. However, they do offer major discounts for students or faculty. They also offer a free trial period, so that you can use and try the software first before you decide to purchase. The trial software is fully functional without watermarks, etc. Many of my students have used it to complete their films. Izotope has a lot of tutorials on their website; as well as many on YouTube made by other users/instructors.
As for the live production sound recording part of your question — it is not a quick answer. We spend months training students and novices in the craft of sound recording. I do not know what mic techniques you used on the set, so it is hard for me to pinpoint where you made your mistakes. But I stress that CONSISTENCY is the key! Learn to adjust your mic distances rather than playing too much with the faders in order to correct for changes in dialogue level. If you mess with the faders, your bg will go up and down like a roller coaster. Instead, play the positioning of your boom mics. As for lavs, once you achieve a decent working level, the bg should not change much unless you have an overactive auto gain control.