Praise be to Allaah.
It is not permissible for you to copy school work from your classmates, because that is a form of cheating and we are forbidden to cheat. The Prophet (peace and blessings of Allaah be upon him) said: “Whoever deceives us is not one of us.” And that may also result in a great deal of harm in this world and in the Hereafter. So you must beware of that and advise others to avoid it.
But if you see the way someone else does the homework and you understand it, then you close his book and write your own answers, there is nothing wrong with that. And Allaah knows best.