This was something I learned late too. Just open the province panel, and it shows who occupies it. If you or a subject occupy it, you can change who is occupying it.
Be warned, if you change it to someone who is not your subject, you cannot change it back, nor initially change it to you if an ally occupies it, even if you are war leader. So be the first one to grab the vital provinces.
If you mark a province as being of interest before you dow or join a war, if your allies do not have a core/claim/marked it as interest, they often will give you occupation. But if they want it, they will happily dick you over.
Remember that unoccupied forts will eventually unsiege provinces next to it, if those provinces are also unoccupied.