Besides some possible pure revenge killings when withdrawing (not unheard of in other wars/armies), from what I understood from the Western reporting on the matter, males were shot after being interrogated about digging ditches etc., so presumed to have supported the Ukrainian defense one way or the other. So Russian soldiers were probably trying to implement a crude version of the (alleged) filtration camps used in Chechnya and possibly in the DNR/LDP.
Also, Russian soldiers were seen somewhat indiscriminately shooting up civilian vehicles (e.g.). Although no vehicle-borne IEDs were reported in this war insofar, you could clearly see some Ukrainian military personnel move in civilian vehicles, and sometimes transporting ammunition that way as well. Some of the (allegedly) intercepted comms between the Russian forces seem to back up this theory, i.e. orders to shoot when in the slightest doubt as to status of people seen in the field.
As I suspected above, both of those scenarios happned, according to a UN report published in Oct 2022:
The Commission found numerous cases in which Russian armed forces shot at civilians trying to flee to safety and obtain food or other necessities, which resulted in the killing or injury of the victims. In the cases documented, the victims wore civilian clothes, drove civilian cars and were unarmed. Most of the incidents took place during daylight, which means that their civilian appearance should have been clear to the attacker. [...]
Investigations in the provinces of Kyiv, Chernihiv, Kharkiv and Sumy reveal a pattern of summary executions in areas temporarily occupied by Russian armed forces in February and March 2022, which are violations of the right to life and war crimes. [...]
In the cases that the Commission investigated, several elements, often in
combination, indicated that the victims were executed. A common element was that
victims were last seen in the custody or the presence of Russian armed forces. The
bodies of the victims were exhumed from separate or mass graves or recovered from
houses or basements that the Russian armed forces had occupied. Some victims’ dead
bodies were found with hands tied behind their back, a clear indication that the victim
was in custody and posed no threat at the time of death.
According to witnesses and survivors, some of the perpetrators accused the
victims of transmitting information to Ukrainian armed forces, of collaborating with
the Ukrainian armed forces or of other contributions to the fighting against Russian
armed forces.
The report also mentions evidence of torture in the latter scenarios. After Ukraine took back Kherson (which is not discussed in that report), there was evidence of torture being practiced more systematically in areas controlled by the Russians longer-term. A later UN presser (Sep 2023) notes:
The Commission’s investigations in Kherson and Zaporizhzhia indicate the widespread and systematic use of torture by Russian armed forces against persons accused of being informants of the Ukrainian armed forces. In some cases, torture was inflicted with such brutality that it caused the death of the victim.
I've been pondering why there was a fair bit on variation in how Russian troops acted in the north and in the south of Ukraine vis-a-vis of civilians. I think a plausible explanation is that there were more ambushes in urban areas in the north. E.g., in the famous Bucha, there was actually a nasty ambush that destroyed an advancing Russian column on Feb 27 on Vokzalna Street. (Photos and even a video of the aftermath of that failed incursion circulated in the media as early as Feb 28.) The Russians eventually sent substantially more forces on March 3 and took Bucha with not much of a fight in the following two days. This occupation lasted until March 30 or so. The initial ambush of the Russian forces in that town probably explains in part the level of brutality that was then meted to the townsfolk once the Russians managed to occupy it. (The somewhat more internationally famous Yablunska street where a dozen bodies in civilian attire were seen later on, runs perpendicular to Vokzalna street. This however is only a fraction of the civilian killed in that town--OHCHR documented at least 73 and the Ukrainians claim more happened.)
Individuals driving vehicles inside the town or nearby, and those trying to leave Bucha, were regularly shot at and killed for no apparent reason. Residents were urged (by threats of weapons and verbal intimidation) to remain in basements and in their homes. Basements and households were regularly raided, and ‘suspicious’ individuals, especially men, were questioned about alleged affiliations (current or
previous) with Ukrainian armed forces and law enforcement bodies, and about alleged “spying”, notably as to transmitting information about positions of Russian troops. Some civilians were killed on the spot, while others were detained and executed later.