You may file for a divorce in Massachusetts if you have lived in the state for at least the previous one year, no matter if the cause of divorce occurred outside of the state.
If you are living in Massachusetts at the time of filing for divorce and the cause of the action occurred within the state you can file for divorce even if you haven't lived in the state for one full year as long as it doesn't appear that the plaintiff moved into the state solely for the purpose of obtaining a divorce.
A divorce may be adjudged for:
When dividing property, the court shall consider:
In dividing the property, the court shall also consider the present and future needs of the dependent children of the marriage. The court may also consider the contribution of each of the parties in the acquisition, preservation or appreciation in value of their respective estates and the contribution of each of the parties as a homemaker to the family unit.
Massachusetts courts may make a judgment for either of the parties to pay alimony to the other. In addition to or in lieu of a judgment to pay alimony, the court may assign to either husband or wife all or any part of the estate of the other, including but not limited to, all vested and nonvested benefits, rights and funds accrued during the marriage, including retirement benefits, pension, profit-sharing, annuity, deferred compensation and insurance.
In determining the amount of alimony, if any, to be paid, the court shall consider:
In making an order of child custody, the rights of the parents shall be held to be equal, and the happiness and welfare of the children shall determine their custody. When considering the happiness and welfare of the child, the court shall consider whether or not the child's present or past living conditions adversely affect his physical, mental, moral or emotional health.
In determining the amount of the child support obligation or in approving the agreement of the parties, the court shall apply the state child support guidelines. The court can deviate from the guidelines if it feels such a departure is consistent with the best interests of the child.
A child reaches the age of majority and is emancipated when the child turns 18, or when the child turns 21 if the child is living with a parent, or when the child turns 23 if the child is enrolled in an educational program.
http://www.malegislature.gov/Laws/GeneralLaws/PartII/TitleIII/Chapter208 (Massachusetts divorce laws)