It is a condition for marrying in Norway that no previous marriage subsists, and this has to be certified by the authorities of the country you're a citizen of. You do not need to be a Norwegian citizen, but you must have a valid residence permit, tourist visa or another kind of permission to be in Norway. For people from within the Schengen area, this in itself is sufficient. For more information about immigration issues, please visit the website of the immigration autorities.
For more detailed information about the requirements of marriage, you can see the Marriage Act directly.
It is the Norwegian registrar's office that checks whether the requirements for marriage are met, see www.skatteetaten.no. You'll find the necessary forms here - "engelsk" means English, so this is the right button to click.
Once you have received the documentation from the Registrar's office (Skatteetaten) that you both fulfil the requirements for marrying, you can contact the local court at the place you want to marry. You can search for the local court here, but the search engine is unfortunately only in Norwegian. You can also write to them at email@example.com.