how do you know when your pokemon wants to play with other pokemon or want to battle them??
that's a really great question and a really important thing for anyone who owns a pokemon to know!
remember, play and battle aren't always separate for pokemon. many pokemon will battle as a primary form of play with other pokemon of the same evolutionary line! the thing to look for is body language and evidence of type energy.
a pokemon that wants to play without battle will often keep its body language "soft" (inviting the other pokemon into its space, not attempting to initiate anything like chasing or wrestling until the other pokemon chooses to interact). many pokemon will start play off this way and work their way up to battle-as-play. a pokemon that wants to battle playfully will often show a mixture of more alert, forward behaviors (chasing, "larger" body language, playfully aggressive things like leg stomping) and those soft behaviors from earlier. it can look a lot like hit-and-run sort of behavior, but it's really "attacking" followed by retreating to see if the other pokemon wants to play along. you may see some early indications of type energy (e.g. frothing bubbles in water types, sparks in electric types) that will progress into actual moves when the pokemon get into the battle.
a pokemon that is initiating battle because it's scared/aggressive/wants to be left alone will generally show much harsher behavior early on. it may fire off moves from a distance as warning, or it may even go straight to trying to hit the other pokemon. if your pokemon is doing this or is trying to play with a pokemon that's doing this, it's time to recall them to their ball.
this is a very basic description of what to look for,, but it's important to make sure you're aware of what play vs. battle behaviors look like in your specific pokemon! for example, dragon types are known to skip a lot of the early indicators of play and just go right to hitting each other. young or poorly socialized individuals may not engage in play "properly." and every pokemon is different. that's why you need to know what's baseline for the species you're raising while also paying attention their individualized behavior!