Buying a home in Massachusetts is a 2 contract process. The offer contract and the Purchase and Sale contract. In most cases the offer contract is a shorter version of the terms and conditions of the deal and the Purchase and Sale is a much longer legal document outlining the terms and conditions of the deal. the P&S is traditionally signed by bother parties between 7-14 days after the offer contract has been executed by all parties.
Are you asking if you need to sell your current residence prior to purchasing a new home? Most people do need to sell in order to purchase. Contact a mortgage broker who will review your finances and advise accordingly.