g | x | w | all
Bytes Lang Time Link
nan241013T202840ZAkhshsha
146Retina200525T213135Zmath jun
585Lua191126T131851ZLuaNoob
313Python 2191125T205541ZChas Bro
228Ruby191126T014419ZValue In
242C# Visual C# Interactive Compiler191125T233027ZGymhgy
073Jelly191124T202223ZNick Ken

France+Soviet Union= French Union

Retina, 146 bytes

'

^(.+)¶\1$
$1 2
/^\w+¶\w+$/&%@/(?<=[aeiou])\B/i%`$
X
/\W.+¶.+\W/&%@/\W/%`$
X
¶.*?X|X(-?).*
$1
-\W
-
/\W.+¶\w+$/&`\w+¶

/^\w+¶.+\W/&`¶\w+

dI
d'I

Try it online!

Test suite

Explanation

'

- - -
dI
d'I

Since Côte d'Ivoire is a special case, remove the apostrophe at the start and insert it back in at the end.

^(.+)¶\1$
$1 2

If a country is repeated, just append the 2

/^\w+¶\w+$/&%@/(?<=[aeiou])\B/i%`$
X

If the counties are both single words:

Choose a vowel at random (but not at the end) from each country's name and insert an X after it.

/\W.+¶.+\W/&%@/\W/%`$
X

If the counties are both multiple words:

Choose a space or - at random from each country's name and insert an X before it.

¶.*?X|X(-?).*
$1
-\W
-

Remove everything after the X from the first country and everything before the X from the second country.

If either country was split at a - we need to preserve it, which makes this part a bit longer.

/\W.+¶\w+$/&`\w+¶

/^\w+¶.+\W/&`¶\w+

If one country has multiple words and the other is a single word, replace the first/last word of the multi-word country with the single word one.

Lua, 614 604 600 585 bytes

g,s,y,e={},{},{}r=math.random for _,v in ipairs({A,B})do c=0 for w in v:gmatch(".?.'?%a+.")do c=c+1(_<2 and g or s)[c]=w end end h=s[1]:find('-')and'-'or' 'u,k=#g,#s if u==1 and k>1then s[1]=g[1]..h e=s elseif u>1 and k==1then g[u]=s[1]e=g elseif u>1 and k>1then c=0 for i=1,r(u-1)do c=c+1y[c]=g[i]end for j=r(2,k),k do y[c]=y[c]:gsub(' ',h)c=c+1y[c]=s[j]end e=y else g,s={},{}for i=1,10 do t=("aeiouAEIOU"):sub(i,i)p=A:sub(1,A:find(t)or 0)g[#g+1]=#p>0 and#p<#A and p or q;p=B:sub(1+(B:find(t)or#B),#B)s[#s+1]=#p>0 and p or q end e={g[r(1,#g)],s[r(#s)]}end return A==B and{A," 2"}or e 

Try it online!

All possible combinations (75532) --> Click!

Python 2, 395 332 336 318 313 bytes

def f(c,d):
 j,k=[' -'['-'in s]for s in c,d];u=c.split(j);v=d.split(k);n,m=len(u),len(v);D=max(j,k);b=D in c+d
 if(n>1)^(m<2):i,j=[choice([i+1for i in range(len(s)-1)if s[i]in['aeiouAEIOU',' -'][b]])for s in c,d];R=c[:i-b]+b*D+d[j:]
 else:R=D.join((u[:-1]or u)+v[m>1:])
 return[R,c+' 2'][c==d]
from random import*

Try it online!

17 bytes thx to Value Ink; and a hat tip to SztupY for pointing out a bug.

Ruby, 230 228 bytes

->c,d{g=->s,r{(0..s.size-2).select{|i|s[i]=~r}.sample}
i=g[c,e=/[ -]/];j=g[d,e];c==d ?c+" 2":(c+d)[e]?c[e]&&!d[e]?c[/.*[ -]/]+d:!c[e]&&d[e]?c+d[/[ -].+/]:c[0,i]+[c[i],d[j]].max+d[j+1..-1]:c[0..g[c,r=/[aeiou]/i]]+d[g[d,r]+1..-1]}

Try it online!

C# (Visual C# Interactive Compiler), 242 bytes

a=>b=>a==b?a+" 2":((d=a.LastIndexOfAny(z=((j=new[]{a,b}.Count(x=>"- ".Any(x.Contains)))>0?"- ":"aeiouAEIOU").ToArray()))<0?a:a.Remove(d+1))+b.Remove(0,j+new Random().Next()>0?(d=b.IndexOfAny(z)-j%2+1)<0?0:d:b.LastIndexOfAny(z));dynamic z,d,j;

Try it online!

Jelly, 74 73 bytes

JṖXṬk⁸ḢḢFṪ;ƲƭF)jṪḢƭ€Ṁ$$
ḢṖ;
ṪḢṪ;Ɗṭ
Fe€ØcṖTXṬkḢḢṪƭ)
e€⁾ -k)ẈỊḄ‘ƲĿ
Ḣ,2KƊÇE?

Try it online!

A full program that takes a list of two strings as its argument and implicitly outputs the mashed up country name.

The handling of hyphens is relatively costly, particularly since they are included whichever side of the split they fall.

Explanation

Helper link 1

Handles case where both countries have multiple words

              )         | For each country:
J                       | - Sequence along words
 Ṗ                      | - Remove last
  X                     | - Pick one at random
   Ṭ                    | - Convert to a boolean list with a 1 at that index
    k⁸                  | - Split list of words after that point
            ƭ           | - Alternate between:
      Ḣ                 |   - Head (first set of words for the first country)
           Ʋ            |   - Following as a monad (for the second country)
       Ḣ                |     - Head (first set of words, also removed from the country)
        F               |     - Flatten
         Ṫ              |     - Tail (i.e. last character which will be space or hyphen)
          ;             |     - Concatenate to remaining words for second country
             F          | - Flatten
                      $ | Following as a monad
               j     $  | - Join countries with following as a monad
                ṪḢƭ€    |   - Alternate between tail for first country and head for second
                    Ṁ   |   - Max (will be hyphen if one present, otherwise space)

Helper link 2

Handles case where only first country has multiple words

Ḣ   | Head (first country)
 Ṗ  | Remove last word
  ; | Concatenate to second country

Helper link 3

Handles case where only second country has multiple words

Ṫ      | Tail (second country)
    Ɗ  | Following as a monad:
 Ḣ     | - Head (first word; note this will also be removed from the first country)
  Ṫ    | - Tail (last character)
   ;   | - Concatenated to remaining words
     ṭ | Tag onto the end of the first country

Helper link 4

Handles case where both countries have single words

              ) | For each country
F               | - Flatten (remove the layer of lists generated in helper link 5)
 eۯc           | - Check whether each character is a vowel
     Ṗ          | - Remove last
      T         | - Comvert to list of indices
       X        | - Pick one at random
        Ṭ       | - Convert to a boolean list with a 1 at that index
         kḢ     | - Split the original country name after that vowel
           ḢṪƭ  | - Alternate between taking the head (for first country) and tail (for second)

Helper link 5

Splits each country into words and dispatched to helper links 1-4 depending on which countries have multiple words

      )       | For each country:
e€⁾ -         | - Check whether each character is a space or hyphen
     k        | - Split country after those characters
           ƲĿ | Call the link indicated by the number calculated by the following monad:
       Ẉ      | Lengths of lists (i.e. number of words in each country)
        Ị     | Insignificant (abs(x)<=1)
         Ḅ    | Convert from binary
          ‘   | Increment by one

Main link

Determines if countries are equal, and otherwise calls helper link 5

      E? | If both countries equal:
    Ɗ    | Then, as a monad:
Ḣ        | - Head (first country)
 ,2      | - Pair with 2
   K     | - Join with spaces
     Ç   | Else: Call helper link 5