Initially check that it autofills ok, get it up to pressure and check for drips from the steam arms and hot water tap or blockage of the steam arms by congealed milk. Dripping from a group would suggest a leaking solenoid.
Look inside for any leaks.
2 years of sporadic work over 5 suggests that it may have been laid up for some time with water in it in which case limescale build-up is a concern. You need to poke around inside to find out. If possible remove a fitting or 2 from the boiler and shine a torch in so you can any chalky looking stuff. If so I'd recommend a full strip down and descale.
Other less critical stuff is the condition of the group gaskets and shower screens - easily replaced but give a good indication of how well a machine has been cared for.
Hope this helps. If I think of anything else I'll come back.