How can we have free will in heaven and not sin?
The short answer to this is Matthew 13:41: "The Son of Man will send out his angels, and they will weed out of his kingdom everything that causes sin and all who do evil."
Many of the things which prompt us to sin now won't be there in heaven. We won't have a physical body (1 Cor 15:42-44) or any physical needs, so we won't have to worry about things like sexual sin, gluttony, etc. Our emotional and spiritual needs (love, acceptance, fulfillment, etc.) will be met, so we won't be tempted to sin in an attempt to meet them ourselves. Negative external influences, including Satan and other evildoers, will be removed. While it is theoretically possible that we could sin, since we'll have free will, it will be much easier for us to live a sinless life in heaven than it is on Earth.
What if someone was married, widowed, and remarried? What happens in heaven - do they have two jealous spouses?
Jesus answered this question in Luke 20:27-38:
Some of the Sadducees, who say there is no resurrection, came to Jesus with a question. "Teacher," they said, "Moses wrote for us that if a man's brother dies and leaves a wife but no children, the man must marry the widow and have children for his brother. Now there were seven brothers. The first one married a woman and died childless. The second and then the third married her, and in the same way the seven died, leaving no children. Finally, the woman died too. Now then, at the resurrection whose wife will she be, since the seven were married to her?"
Jesus replied, "The people of this age marry and are given in marriage. But those who are considered worthy of taking part in that age and in the resurrection from the dead will neither marry nor be given in marriage, and they can no longer die; for they are like the angels. They are God's children, since they are children of the resurrection."