You are right Soph. After a federal election, all the members of the House of Representatives and senators meet with their parties to choose their leader. The leader of the party (or coalition of parties) with the support of the majority of members elected to the House of Representatives – the government – will become the Prime Minister. The Prime Minister is traditionally a member of the House of Representatives, not a senator.
This also means that, at any time, the government can choose to vote for a new leader who will then become Prime Minister.