The ceiling always goes on first. That way the walls will support the edges of the ceiling, eliminating the need for perimeter nailing. If you put the walls up first, the ceiling may sag and drop down along the wall, cracking the plaster at the joint.
Which way to put drywall on the walls is influenced by the fact that the two long edges of all drywall have indentations to receive tape and plaster, while the two ends are cut square with no provision for a plaster joint. Professionals always install drywall on the walls horizontally. DIYers should always install it vertically on the walls. Why? The pros can get drywall from 8 to 14 feet long, often installing a single piece wall to wall. That leaves them with a single convenient joint to plaster right at the 4 foot height. If they do have to butt two pieces together end to end, they have the tools and experience to create a plaster joint over the butt joint that is flared to 3 or 4 feet wide. The joint does stick out, but flaring the compound out this far effectively hides it. An amateur trying that will leave an unsightly bump every 8 feet.
By putting up the drywall vertically you create 20% more joints and have to undertake the backbreaking job of applying joint plaster floor to ceiling. But you are always working with valleys where you can hide your tape and joint compound, and you stand a better chance of having a seamless job.