If you're confident that your friend is capable of running a business (with your skills to help him - although I hope you're a fast learner, because two years of programming isn't very long) - and that his idea will do well enough to support both of you, then by all means do it. If you're sceptical at this stage, stay at school and code in your spare time, and then start something when you're finished or when the right opportunity comes along.
Coming from someone who quit school at your age and ended up - well, successful enough :-)