This question already has an answer here:
Did God allowed incest before? Did Noah and his family committed incest? If yes when did God start forbidding it and why? If no, how did Noah and his family repopulate the world and how about the risk of genetic diseases caused by the inbreeding?