A woman was married to Mr. a for many years and had children with him, after he passed away she married Mr. b, whose name goes on her matzava a or b?
There isn’t any specific halachos regarding this, and it depends on the individual situation, and the feelings of the people involved. Here are some examples of factors that might influence the decision. How long was she married to each husband? Where is she being buried? What will be the feelings of her children, and the family of both husbands? Is it possible to put in the names of both husbands? What would the deceased person want written?
All of these factors can make a difference, depending on your specific instance.