You are thinking on the right lines:
> I try to make a condition (if columns 2 and 3 are empty, do something)
Specifically,
* if columns 2 and 3 are empty, save the value of column 1 and continue
* otherwise, prepend the saved value to the line and print it (there are several `awk`ish ways to do this)
So for example
awk -F, '$2=="" && $3=="" {pfx=$1; next} {print pfx "," $0}' file.csv
or more idiomatically using the `FS` field separator variable
awk -F, '$2=="" && $3=="" {pfx=$1; next} {$0 = pfx FS $0; print}' file.csv
or (since the default action - when a rule evaluates true or `1` \- is to print the record)
awk -F, '$2=="" && $3=="" {pfx=$1; next} {$0 = pfx FS $0} 1' file.csv
John,bim,bam,boom
John,tim,tam,toom
John,lam,loom,lim
Mary,pam,pim,poom
Mary,dam,dim,doom