Aircraft head on or nearly so: turn right to avoid. The “nearly so” comes down to common sense aka. AIRMANSHIP (50 shades of grey)
ATC will allocate levels in controlled airspace.
Outside CAS the TR°(M) will normally determine level allocations.
Keep it simple. Don’t look for complications as you will tie yourself up in knots