\"Contains\" in Entity Framework core should equivalent to the SQL %like% operator. Therefore \"Contains\" should be case insensitive however it is case sensitive! (at least
My answer will concern NpgSQL.
EF.Functions.Like() in PostgreSQL is case-sensitive, but you can use EF.Functions.ILike() extension method located in Npgsql.EntityFrameworkCore.PostgreSQL assembly.
If you don't have reference to Entity Framework assembly in place where you build query, you can use combination ToLower() and Contains() methods, because Npgsql is able translate ToLower() method to correct SQL
Example:
context.Counties.Where(x => x.Name.ToLower().Contains(keyword.ToLower())).ToList();
About second method keep in mind: you may have performance problems and may encounter problems associated with encoding.