If you hold a green card you may be outside the US for up to 6 months without losing it. However it's better to let immigration know in advance and it's even better to confine your out of US visits to 2 weeks. In the current anti-immigration climate being gone for 6 months is asking for trouble. Note also that anytime you leave the US the customs officer at the airport on your return can deny you entry regardless of your green card status. You can then contest that denial of entry (and I have done so successfully) but why taunt a pit bull.
If you remain outside the U.S. for any longer than six months at a time, CBP can place you into removal proceedings and charge you as abandoning your residence. It is critical to remember that your "green card" is merely a document indicating you are a "permanent resident." A permanent resident is someone who intends to remain in the U.S. indefinitely. If you have already made the determination in your mind that you want to leave, you are technically in violation of your status.
Please consult with an attorney and fully discuss your personal situation as to why you need to remain outside the U.S. for extended periods of time.