If you need the money in 2 years, I wouldn't leave it in the stock market. Find a money market or CD to avoid the gamble. You're going to get hit with capital gains taxes either now or in 2 years, so that shouldn't impact your decision.
My personal time frame is 4-5 years of emergency funds. You can adjust that for your own risk tolerance, but have a look at various past crashes to make an educated decision.
I'd only leave it invested if you don't actually need it, because college can be delayed or financed with student loans.