It is easier to write these formulas if you share screen captures with sample data and sample results.
If you want the contents of {Column A} and {Column B}, you can just show both. If either is blank, it won't show anything. Note that if you want something other that a space between the column values, this particular formula will not work.
TRIM(CONCATENATE(
{Column A},
" ",
{Column B}
))
If you don't want to show {Column B} even if it has a value when there is no value for {Column A}, you can try something like this.
TRIM(CONCATENATE(
{Column A},
" ",
IF({Column A}, {Column B})
))
And another option, just for fun because there are so many ways to do things in code. This one will also only show {Column B} if {Column A} has a value. This one lets you put any characters you want between the two values.
IF(
AND(
{Column A},
{Column B}
)
{Column A} & ", " & {Column B},
{Column A}
)