Upstaging is a fine art to ensure that you remain the centre of attention on stage, drawing focus even when you aren't speaking. It's the best way instantly to make yourself unpopular with your stage colleagues.
The everyday equivalent is the photobomb!
Firstly, there's upstaging by stage position. You make sure that you always stand slightly upstage of anyone speaking to you so that their face is necessarily turned away from the audience. It can be a slight shuffle, or a carefully choreographed (but probably unrehearsed) move to a more upstage position - looking out of a window or grabbing an extra drink from the trolley.
If both actors are aware of what's going on, it can sometimes lead to a steady move of both characters to the back of the stage as they each try to gain the upper ground. The only solution to this is for one of the actors to break downstage centre dramatically and address their lines seemingly over their shoulder whilst facing the audience head on. It can be a bit like a sprint cycle race in that way - careful jockeying for position before a decisive, swift move.
Secondly, you have some business or activity that distracts from what is supposed to be the main action. It can be a something dramatic like a huge sneezing fit, but often a slight but persistent activity is enough. Brushing hairs from your coat, a tickly cough or just plain over-reaction to the main action.
We saw a production of Shakespeare last year where the upstaging in all forms was simply hilarious to watch. Goodness knows how (or if) they were allowed to get away with it but these were supposedly mostly professional actors.