First, you need to make sure you've installed and loaded the mod_geoip module (more info here). Then you want your rules to be the other way around, since the first rule would simply match all countries, redirect, and the second rule will never be reached:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|android|iphone|ipod|ipad|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|sgh|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|operamini|palm|plucker|pocket|psp|samsung|sanyo|sch|smartphone|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windowsce|xda|xiino) [NC]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CA|US|MX)$
RewriteRule ^(.*)$ url2 [R=302,L]
RewriteCond %{HTTP_USER_AGENT} (mobile|android|iphone|ipod|ipad|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|sgh|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|operamini|palm|plucker|pocket|psp|samsung|sanyo|sch|smartphone|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windowsce|xda|xiino) [NC]
RewriteRule ^(.*)$ url1 [R=302,L]
Alternatively to using GEOIP_COUNTRY_CODE
, you could also use:
RewriteCond %{ENV:GEOIP_CONTINENT_CODE} ^NA$
for all of North America.