Living together is illegal for unmarried couples in Qatar. Qatar is an Islamic country and it is against the Islamic law for unmarried couple to live together. Man and woman are not allowed to share a living space unless they are legally married. It is also applicable to those friends or flat mates who share the same living space.
In Qatar even if it is not legal many unmarried couples are living together. There is a very less chance of getting arrested unless you do any other crime and being investigated or your neighbour call the police.
Some employers will provide accommodation for their employees. They will not at all entertain unmarried couples living together. Your employer (sponsor) has the full responsibility of their employees. They have to make sure that their employees abide to the local law.
Be especially careful if you are planning to live with someone of the opposite gender who is separated, but not legally divorced. In the eyes of the law, they are still married and they could be charged with adultery which is a much higher offense in Qatar.
In Qatar you are getting freedom for doing many things, but never forget that you are living in an Islamic country. We should give respect to their culture and laws.